

You can also get the JAVA_HOME value for a specific JVM like this: $ /usr/libexec/java_home -v 1.6 I had a similar situation at work, so I did a bit of research and, with a couple minutes of setup, it can be almost painless to switch back and forth between Java 6 and 7 (or 7 and 8, for that matter - this method is version agnostic).įor anyone with java installed, /usr/libexec/java_home will show the JAVA_HOME directory, but it's especially powerful when you have multiple versions of java installed side-by-side on OS X.
