Java 8 as the default VM on OS X Mavericks

Friday, April 18, 2014

Installing Oracle Java SE 8 SDK on your Mac with OS X Mavericks maybe it doesn't change the default JDK and JRE.

For example, if you installed Java 8 and the terminal command:

java -version

prints something like

java version "1.6.x"

you are not using the new version by default.
A simple setting could be:

  1. open a Terminal window
  2. type nano ~/.profile
  3. add the following row to that file: 
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home

Close Terminal and reopen it, type again java -version and now it should produce something like: 

java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

That's all.

You Might Also Like

0 commenti