JDK 7 on OSX
You can download a dmg from Oracle’s download page. You might expect that you’d run the installer and you’d be ready to go. Not me.
I had previous versions of Java installed. In my startup file (.bash_profile) I had set this:
1 |
export JAVA_HOME=/Library/Java/Home/ |
With this set, java -version still reported 1.6.
I set it to this and things worked.
1 |
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home |
That’s a bit clunky. There is a better way.
1 |
export JAVA_HOME=$(/usr/libexec/java_home) |
If you want to use another version, e.g. 1.6
1 |
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) |
One Reply to “JDK 7 on OSX”