What are the default settings for Java_Home

How can I change the Mac OS Java VM default setting returned by / usr / libexec / Java_home?

(I wasn't sure if this should go on SU ... migration is certainly an option, but more programmers read questions here, so here it goes).

I am using Mac OS X 10.8.4 and have installed JDK 1.6.0_51 from Apple and JDK 1.7.0_25 from Oracle. I recently installed the Oracle 1.8 Preview JDK for pre-release software that required it. Now when I run / usr / libexec / Java_home I get the following:


However, run:


This means that the standard version of Java is currently the pre-release version which corrupts some "normal" packages (in my case VisualVM).

I can't set it because environment variables are ignored when applications start, even if started from the command line (for example).

So is there a file I can edit to change my JVM order settings global to set?

(Please don't ask me to launch the Java Preferences Panel as this just won't work: it doesn't contain anything useful and just lists one of the 4 JVMs I have installed.)

Update :

Oracle JVMs live in. Renaming the JDK 1.8 directory to doesn't change anything: still find it in the right place, and running / usr / bin / Java will still run the 1.8 JVM. This is not a problem with synlinks etc.

Answers to similar questions

Although this answer says how much the hack that prevents versions of Java from being captured by Java_home does, it answers this question from how Java_home chooses its default setting and indicates whether users can set it non-destructively.