Java Preferences won't start

David DeHaven david.dehaven at oracle.com
Fri May 17 08:05:07 PDT 2013


>>>> /usr/libexec/java_home
>>>> 
>>>> See the man pages for java_home at http://www.unix.com/man-page/all/1/java_home/
>>> 
>>> This tool returns the default value for JAVA_HOME, and in my case it returns the path to the 7u10 JDK. But the java_home can't change the default value. Where does this tool get it from and how do I change it?
>> 
>> There isn't any mechanism to set the order. When you request a specific major version, java_home will give you the latest version it finds. IOW, if you call /usr/libexec/java_home -v 1.7 it would return /Library/Java/JavaVirtualMachines/jdk1.7.0_10.jdk. Without args it should return the latest major version which is jdk1.8.0.jdk. You'll have to use JAVA_HOME or explicit paths to pick a particular version.
> 
> Indeed, there's JAVA_HOME set in my environment. However, even if I unset this variable, /usr/libexec/java_home still returns the path to 7u10 even though I have the 1.8 installed. This is strange. (I haven't restarted my Mac after installing JDK8 though, perhaps this might help).

No, restarting shouldn't have any effect since the JDKs are scanned dynamically. That is odd. I have 1.8 b67 and it chooses that over the two JDK7 builds in there if no version is given. I haven't tried with a more recent build yet.

-DrD-



More information about the macosx-port-dev mailing list