Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
If you are working on Mac OS X version 10.7 or Lion, you'll find that Java is not installed by default on this version of the operating system. It's up to you to go get Java and install it. This is pretty easy to do, just go to the Apple website at this URL, support.apple.com/kb/DL1421. Click the Download link and follow the prompts to download the software. I've downloaded the installer to my desktop.
It's a dmg file and when you open it up it shows a conventional installer package. Run the installer and walk through all the prompts to install Java. There are no options to take care of, so the installation is fairly automated. This version of the installer is for Java SE 6, 220.127.116.11, the latest version of Java for Mac as of this recording. Once you've completed the installation the next step is to test it. I recommend using Terminal for this. I'll go to the Lion Launchpad application which opens up my applications.
I'll go to Utilities and then to Terminal. Now to test the installation of Java, first type java, all lower case, then a space and -version, press return and you should see an output showing you which version of Java is installed on your system. Again I am running Java 6 maintenance release 26. You should also test to make sure you can get to the Java compiler type javac space -version and once again you should get a little bit of output. This time just showing the version number.
If you can do this much you are in great shape and you are ready to go to the next step installing Eclipse, but before you finish up this video, I'll show you where Java is actually installed. You'll need to know this location for certain configurations tasks during this video course. In Terminal from the command line type cd space /System, make sure that you are using an uppercase S because Mac OS X is case sensitive, then /library, then /frameworks.
Press Return and the type ls Ja* and that will show you a listing of everything starting off with the word Java. I am looking for the items at the bottom of the listing under JavaVM. Framework so I'll type cd then JavaV, with an uppercase V, and I'll press tab and let Terminal auto complete the directory name. I'll press Return then I'll issue the Clear command to clear the screen and then ls to see what's in here.
You'll see that there are directories for Classes, Frameworks, JavaVM and so on. The directory you are interested in is commands. So I'll type cd space Commands and return and then ls and there are all the Java commands including Java, javac, javadoc and many, many others. Again you'll need to know this particular directory location later on in the course when you configure Eclipse to tell it where certain tools are such as the javadoc command.
So now you have installed Java, you've tested it to make sure you can run both the Java Virtual Machine and the compiler and you've seen where the Java files are installed and you are ready for the next step in the process installing Eclipse on your system.
Get unlimited access to all courses for just $25/month.Become a member