I'm running El Capitan and java -version produces the following:

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

I'm having severe slowdown problems with the h2 database console, so I want to see if going back to Java 1.6 has any effect.

I run the Java Preferences application and move 1.6 so it's at the top, but the next time I launch Java Preferences 1.8 is back up there! Even unchecking 1.8 doesn't persist -- it's rechecked on the next launch.

How does one go about selecting a particular Java version these days?

1 Answer 1


Maybe just put the following in your ~/.bashrc:

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
  • Thanks...so what would I do after the test, to get back to normal (1.8)? The last time I messed with my path variables I had to do a complete system restore so I'm a little anxious :-)
    – skiaddict1
    Dec 17, 2016 at 5:37
  • To get back to 1.8 you could just type export JAVA_HOME=`/usr/libexec/java_home -v 1.6` from the command line (and remove the export JAVA_HOME=`/usr/libexec/java_home -v 1.6` from your ~/.bashrc Dec 17, 2016 at 8:02
  • Awesome, thank you so much. Test completed and useful results obtained. Many thanks :-)
    – skiaddict1
    Dec 17, 2016 at 21:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .