![]() ![]() Some additional alias to switch between the different versions: alias j8='export JAVA_HOME=$JAVA_HOME8 export PATH=$JAVA_HOME/bin:$PATH'Īlias j9='export JAVA_HOME=$JAVA_HOME9 export PATH=$JAVA_HOME/bin:$PATH' Set active Java: export JAVA_HOME=$JAVA_HOME8 Note, that for the latest version it is 9 and not 1.9. ![]() bash_profile: export JAVA_HOME8=`/usr/libexec/java_home -version 1.8`Įxport JAVA_HOME9=`/usr/libexec/java_home -version 9` Note, updating this to 1.8 works just fine. export JAVA_HOME=`/usr/libexec/java_home -v 1.7` Update: Understanding Java From Command Line on OSX has a better explanation on how this works. ![]() usr/libexec/java_home still insists on 1.6. The only fix that actually works for me is setting JAVA_HOME manually: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/Īt least this way when run from the command line it will use 1.7. It does list the 1.7 JVM but I can toggle/untoggle & drag and drop all I want there without actually changing the output of /usr/libexec/java_home.Įven after installing 1.7.0 u6 from Oracle on Lion and setting it as the default in the preferences, it still returned the apple 1.6 java home. That's what the Java Preferences app is for, which in my case seems broken and doesn't actually change the JVM correctly. It outputs the currently configured JAVA_HOME and doesn't actually change it. usr/libexec/java_home is not a directory but an executable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |