Join the DZone community and get the full member experience.
- If you have not yet installed Apple's Java OS X 2012-006 update, then you are still using a version of Apple Java 6 that includes the plug-in and the Java Preferences application. See Notes for Users of macOS That Include the Apple Java 6 Plug-in.
- There are alternatives like OpenJDK, which in many cases don't provide support of operating system's installation method (e.g. OpenJDK doesn't provide a.dmg file for Max OS X's own installation method but a tar.gz, which you need to extract and place to a proper directory on your own). Instruction to install (as usual in Max OS X).
- Java/Mac FAQ: Where is JAVAHOME located on Mac OS X (macOS) systems? MacOS JDK location. This has changed over time, but if you're using Mac OS X 10.9 or newer (now macOS), your JDK/SDK JAVAHOME location for Java 8 will be something like this.
Download JDK Source code for Mac OS X. The JDK source code is packaged in a src.jar, and should be in the JDK/Home folder. However, some JDK versions in Mac OSX didn't include the source code or Javadoc.
As long as I've been using a Mac I always understood that if you needed to set $JAVA_HOME for any program, it should be set to /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK.
On my machine this points to the 1.6 JDK:
This was a bit surprising to me since I've actually got Java 7 installed on the machine as well so I'd assumed the symlink would have been changed:
Andres and I were looking at something around this yesterday and wanted to set $JAVA_HOME to the location of the 1.7 JDK on the system if it had been installed.
We eventually came across the following article which explains that you can use the /usr/libexec/java_homecommand line tool to do this.
For example, if we want to find where the 1.7 JDK is we could run the following:
And if we want 1.6 the following does the trick:
We can also list all the JVMs installed on the machine:
I'm not sure how I've never come across this command before but it seems pretty neat.
Published at DZone with permission of Mark Needham, DZone MVB. See the original article here.
Java Jdk 1.6 For Mac Os X64
Opinions expressed by DZone contributors are their own.