

- Setting java_home for multiple java versions on mac mac os x#
- Setting java_home for multiple java versions on mac install#
Jenv add /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk_EXAMPLE_/Contents/Homeĩ. these are just EXAMPLE's jenv add /Library/Java/JavaVirtualMachines/1.6.0_EXAMPLE_/Contents/Home WARNING: Use the actual paths on your machine. We need to add "/Contents/Home" to the version folder. Review InstallationsĪll Java version get installed here: /Library/Java/JavaVirtualMachines lets take a look. ? Maybe close and restart Terminal so it sees any new ENV vars that got setup.
Setting java_home for multiple java versions on mac install#
Install java 6 (or 7 or 8 whatever you need) brew cask install java6 Install the latest version of java brew cask install javaĦ. Add jenv to your path export PATH="$HOME/.jenv/shims:$PATH"įYI: "Tap" extends brew's list of available repos it can install, above and beyond brew's default list of available repos. Add jenv to the bash profile if which jenv > /dev/null then eval "$(jenv init -)" fiģ.

If you haven't already, install homebrew.Ģ. This guide was cobbled together from various sources (replies above as well as other posts), and works perfect.
Setting java_home for multiple java versions on mac mac os x#
On Mac OS X Mavericks, I found as following:ġ) Built-in JRE default: /Library/Internet\ You can check the paths of the versions installed using /usr/libexec/java_home -V, see How do I check if the Java JDK is installed on Mac? I think this is the cleanest & simplest way to go about it.Īnother important thing to note, as mentioned in Mac OS X 10.6.7 Java Path Current JDK confusing :įor different types of JDKs or installations, you will have different Then you can install the version(s) you like: brew cask install java7Īnd add them to be managed by jenv as usual. Then you can look at all the versions available: brew search java
