Fixing Java version in OSX

Atelier needs Java 1.8 to run, but manage diferent versions of Java can be tricky in OSX

This command clear some problems:​
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
  1.8.0_60, x86_64:    "Java SE 8"    /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
  1.6.0_65-b14-466.1, x86_64:    "Java SE 6"    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  1.6.0_65-b14-466.1, i386:    "Java SE 6"    /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home​

Oracle's installer puts java inside the /Library/Internet Plug-Ins/JavaAppletPlugin.plugin. And it doesn't overwrite /usr/bin/java. So, if you issue a

$ whereis java
in the terminal, it'll return /usr/bin/java. (which in turn points to /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java, which is Apple's 1.6 version).

So, if you want to use the new java version, replace the /usr/bin/java symlink so that it points to /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java instead:

$ sudo rm /usr/bin/java
$ sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin

  • + 2
  • 0
  • 2473
  • 9

Comments

Stefan, the link gives me "Sorry, the page you were looking for in this blog does not exist"

Just to add, I would be happy to look at sorting this out for ISC (and sign the resulting package correctly so it will work with GateKeeper). My rates are very reasonable!

If using OS 10.11 there is an additional security setting called system integrity protection. This can be disabled by booting into recovery mode which i have done.

I have then  followed  the instructions above but  get the following alert when starting up Atelier

the JVM shared library "/Library/internet plug-ins/javaappletplugin.plugin/contents/home/bin/../lib/server/libjvm.dylib" does not contain the J NI_createjavaVM symbol.

Any idea what this means ?

 

thanks

k

We (ISC) cannot distribute the java virtual machine due to Oracles licensing restrictions. We ARE working on code-signing however, in order to be a good citizen, though the practicalities of that are challenging.

On Mac OS X.11 what fixed my Java problems was adding the following line to my .bash_profile:

export JAVA_HOME="$(/usr/libexec/java_home)"

Here is what I did:

Installed JDK 1.8 from Oracle site

Deinstalled JDK 1.6 from my Mac

Put the above in my .bash_profile

Restarted terminal so it picked up definitions in .bash_profile (I could have run from the terminal 

. ~/.bash_profile  )

 

Ref: the JVM shared library "/Library/internet plug ins/javaappletplugin.plugin/contents/home/bin/../lib/server/libjvm.dylib" 

 

This problem can be mitigated by installing the Java 1.8 JDK. Oracle states that the JRE does NOT update the symbolic links appropriately whereas the JDK does. Thus for MacOSX only we will now REQUIRE that the JDK be installed. We are sorry for any inconvenience this may cause but these are circumstances beyond our control. Thank you.

he JVM shared library "/Library/internet plug-ins/javaappletplugin.plugin/contents/home/bin/../lib/server/libjvm.dylib"