0

I I donwloaded the last mac os JDK (jdk-8u5-macosx-x64) from the oracle website and install it sucsefully. Reboot the laptop but my java compiler version still the same

javac -version
javac 1.6.0_51

Edit I just changed the Java_Home variable in ~/.bash_profile to the new one /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home. It works perfectly

user567
  • 3,712
  • 9
  • 47
  • 80
  • Note [this](http://stackoverflow.com/questions/15120745/need-help-understanding-oracles-java-on-mac?rq=1) question with similarities... – abiessu Jul 09 '14 at 17:07

1 Answers1

0

Uninstall the current JDK and install jdk-8u5 again.

You can uninstall it using the following:

To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.

Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:

/Library/Java/JavaVirtualMachines/jdkmajor.minor.macro[_update].jdk For example, to uninstall 8u6:

% rm -rf jdk1.8.0_06.jdk Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.

Taken from http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html#A10969

Kurt Wagner
  • 3,295
  • 13
  • 44
  • 71