Get the Latest Version of Java
Before you can write Java programs for Android devices, you need some software tools, including the latest version of Java. You can get the latest, greatest version of Java by visiting the Java website. The site offers several alternatives.
(Recommended) Click the big Free Java Download button on the site’s main page.
For most computers, clicking this Free Java Download button gives you all the Java you need.
If you’re running Mac OS X 10.6 or earlier (or if you’re running OS X 10.7 and you haven’t upgraded to OS X 10.7.3 or later), clicking the Free Java Download button opens a “Sorry, Charlie!” page that tells you to download Java directly from Apple. Follow the instructions on that page to install Java on your computer.
(Optional) Follow the Do I Have Java? link.
When you follow this link, the web browser scans the computer for Java installations. You should have Java 6 (also known as Java 1.6) or later (Java 7, Java 8, or whatever). If your version of Java is older than Java 6 (or if the scan doesn’t find Java on the computer), click one of the Download buttons on the Java website.
(Optional) Pick and choose among Java versions.
If you click the All Java Downloads link on the Java website, you can pick and choose from among several versions of Java — 32-bit and 64-bit versions for Windows, Mac, Linux, and Solaris computers.
This alternative is useful for overriding the default Free Java Download button’s choice. For example, you want the 64-bit version of Java even though the Free Java Download button gives you the 32-bit version. Later, you might visit the Java website with a Windows computer to download Java for your Macintosh.
(Optional) Cleanse your computer of all but the latest version of Java.
On the Java website, the Remove Older Versions link promises to clean up any Java clutter you’ve collected over time. This Remove Older Versions step is optional.
Visit the Remove Older Versions link if you’re having trouble that you suspect is Java related. But don’t worry about an impending disaster from not having followed the Remove Older Versions link.