The Apple Java for OS X 2012-006 1.0 update for Mac OS X 10.7, 10.8 operating systems delivers improved security, reliability, and compatibility by uninstalling the Apple-provided Java applet plug. It's pretty simple to switch Java versions instantly on OS X without needing to change the $JAVA_HOME variable. I am running 10.8.2, and my $JAVA_HOME variable points to /Library/Java/Home echo $JAVA_HOME This path is a symbolic link, as can be seen by running ls -l command ls -la /Library/Java The default symbolic link points to Home -> /Library/Java/JavaVirtualMachines/1.6.0_33-b03-424.jdk/Contents/Home/ To redirect java to my 1.7 installation, I merely replace the old Home symlink with a new symlink pointing to the home directory of my Java 1.7 installation. How to code java on mac for beginners. Cd /Library/Java mv Home Home-1.6 ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/ Home And voila! Java -version shows that I am now running java 1.7. Just switch which symlink is currently named 'Home' to instantly change the default java JRE. Here is a easy way to switch java 6 and java 7 on mac osx. Step 1: download jdk 7 from oracle official website and install it step by step follow the tips. Step 2: set $JAVA_HOME in.bash_profile $ vim.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) $ source.bash_profile $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home step 3: if you want to use jdk 6, just alternative $JAVA_HOME to jdk 6 home path $ vim.bash_profile export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) $ source.bash_profile $ echo $JAVA_HOME /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home. Create emulator of mac os x to xcode apple app. It's pretty simple to switch Java versions instantly on OS X without needing to change the $JAVA_HOME variable. I am running 10.8.2, and my $JAVA_HOME variable points to /Library/Java/Home echo $JAVA_HOME This path is a symbolic link, as can be seen by running ls -l command ls -la /Library/Java The default symbolic link points to Home -> /Library/Java/JavaVirtualMachines/1.6.0_33-b03-424.jdk/Contents/Home/ To redirect java to my 1.7 installation, I merely replace the old Home symlink with a new symlink pointing to the home directory of my Java 1.7 installation. Cd /Library/Java mv Home Home-1.6 ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/ Home And voila! Java -version shows that I am now running java 1.7. Just switch which symlink is currently named 'Home' to instantly change the default java JRE. Here is a easy way to switch java 6 and java 7 on mac osx. Step 1: download jdk 7 from oracle official website and install it step by step follow the tips. Step 2: set $JAVA_HOME in.bash_profile $ vim.bash_profile export JAVA_HOME=$(/usr/libexec/java_home) $ source.bash_profile $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home step 3: if you want to use jdk 6, just alternative $JAVA_HOME to jdk 6 home path $ vim.bash_profile export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) $ source.bash_profile $ echo $JAVA_HOME /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home.
0 Comments
Leave a Reply. |