Cannot Change Java Version Using Java Preferences

When I attempt a change of the current Java version (say, switching from 1.5 to 6) using Java Preferences, the change is reflected in the preferences, but the update does actually occur and java -version continues to report Java 1.5 as the current version.

If I create another account, this work just fine and I can switch versions at will. Anyone have any idea what might be missing from my account?

MacBook, Mac OS X (10.5.7)

Posted on Jun 22, 2009 1:00 AM

Reply
1 reply

Jun 22, 2009 5:17 AM in response to stonehippo

Ok, I figured out what was going on: I had explicitly set my JAVA_HOME in ~/.bash_profile, pointing to the symlinked path for the current JSE. It turns out there a new CLI tool /usr/libexec/java_home that can be used to assign JAVA_HOME like this:

export JAVA HOME=`/usr/libexec/javahome`

Using this will ensure that JAVA_HOME is set to the correct value when the shell starts up (if you don't have JAVA_HOME set at all, you can switch the JSE versions in the Terminal 'on-the-fly' when changing the Java Preferences setting).

http://lists.apple.com/archives/java-dev/2009/Jun/msg00139.html

Message was edited by: stonehippo

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.

Cannot Change Java Version Using Java Preferences

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