Set Java 7 as default JVM on Mac OSX Mountain Lion
2013-08-14 23:09
239 查看
I recently had an issue where an application I wanted to run on Mountain Lion needed Java 7 as the default JVM on the machine. The install for the app in question worked without errors, but the issue was highlighted when trying to run the app.
Here’s how I fixed the problem.
Firstly, open Terminal and find out the current default Java version on your machine:
Download the Java 7 JDK from the Java SE site (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Run the installer. Now, for me this still didnt ensure that the updated Java version was the current one used by the system.
In Terminal, navigate to the following location:
The CurrentJDK symlink in this directory was still pointing to an older Java version. To resolve this, remove the symlink and create a new one pointing to the new Java 7 JDK (you may need to use sudo to run these commands):
This fixed it for me. To confirm, check the Java version once again in Terminal:
转载地址:http://www.mattgifford.co.uk/set-java-7-as-default-jvm-on-mac-osx-mountain-lion
Here’s how I fixed the problem.
Firstly, open Terminal and find out the current default Java version on your machine:
java -version
Download the Java 7 JDK from the Java SE site (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Run the installer. Now, for me this still didnt ensure that the updated Java version was the current one used by the system.
In Terminal, navigate to the following location:
cd /System/Library/Frameworks/JavaVM.framework/Versions/
The CurrentJDK symlink in this directory was still pointing to an older Java version. To resolve this, remove the symlink and create a new one pointing to the new Java 7 JDK (you may need to use sudo to run these commands):
rm CurrentJDK
ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/ CurrentJDK
This fixed it for me. To confirm, check the Java version once again in Terminal:
java -version
转载地址:http://www.mattgifford.co.uk/set-java-7-as-default-jvm-on-mac-osx-mountain-lion
相关文章推荐
- 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)
- 在OSX狮子(Lion)上安装MYSQL(Install MySQL on Mac OSX)
- How to set JAVA_HOME on mac
- java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=t
- Set up SSH for Git and Mercurial on Mac OSX/Linux
- SFML on Mac (Xcode 4.5.1 + Mountain Lion 10.8)
- How to Install mcrypt for php on Mac OSX Lion 10.8 & 10.7 Development Server
- gradle 安装错误:JAVA_HOME is set to an invalid directory: /usr/lib/jvm/default-java
- Maven, JAVA_HOME is not defined correctly on Mac OSX
- How to Set $JAVA_HOME environment variable on Mac OS X
- gradle 安装错误:JAVA_HOME is set to an invalid directory: /usr/lib/jvm/default-java
- Install and set JAVA home on MAC OS with commandline
- 苹果操作系统 Mac OSX Mountain Lion v10.8
- 关于Java的setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
- Install lp_solver on Mac 32/64-bit (Run it with Java ILP from Eclipse)
- Uninstall JavaVM and Xcode On Mac OS X
- The Layout Process on Mac OSX and iOS
- Vmware10下安装Mac OS X Mountain Lion10.8.5
- How to restore deleted chrome bookmarks on Mac 10.7.3 Lion
- How to install YAWS on Mac OSX