JAVA_HOME is not changed in Sierra

I have upgraded to Sierra 10.12.1 and just found out that the JAVA_HOME is changed. Instead of /System/Library/Frameworks/JavaVM.Framework/Home it is now /System/Library/Frameworks/JavaVM.Framework/Versions/Current and the java command is in folder Commands instead of bin. The problem is that the external program has the JAVA_HOME path set as earlier one and expect Java command in bin folder under it. I tried using soft link 'ln -sf' but that also is not permitted. Any help is appreciated.

iOS 10.1.1, macOS Sierra 10.12.1

Posted on Dec 13, 2016 8:59 PM

Reply
1 reply

Jan 25, 2017 8:42 AM in response to shalensh

So it's in part a trick of setting it correctly in your /etc/profile

See this StackOverflow link

http://stackoverflow.com/questions/30454505/mac-os-how-to-set-java-home-correctl y-in-the-path


export JAVA_HOME=`/usr/libexec/java_home`


Generally you would see this and likely write this with double quotes, but those are backticks.

This links JAVA_HOME to a similarly named tool in the system that will find the most appropriate JAVA_HOME based on what is currently installed from an official Java Installer.


Open the text file /etc/profile in any text editor in plain text and add that line.

Save it, and enter an administrator password to do so.

When you restart Terminal.app you will see java behave correctly there.


https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPag es/man1/java_home.1.html

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

JAVA_HOME is not changed in Sierra

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.