When only Java 7 is installed on Mac OS X and Java 6 is not installed, open Eclipse and other software dependent on Java, and you may encounter:
To open "Eclipse," you need a Java SE 6 runtime. Wocould you like to install one now?
This error message is found and tested. Here are two solutions.
1. Modify the Info. plist file in the Java installation directory:
For example, modify the/Library/Java/JavaVirtualMachines/jdk1.7.0 _ 45.jdk/ Contents/Info. plist file on my system.
The code is as follows: |
Copy code |
<Key> JVMCapabilities </key> <Array> <String> CommandLine </string> </Array> |
Changed to the following: (4 rows of stuff are added)
The code is as follows: |
Copy code |
<Key> JVMCapabilities </key> <Array> <String> JNI </string> <String> BundledApp </string> <String> WebStart </string> <String> Applets </string> <String> CommandLine </string> </Array> |
After the modification, restart the system, and then enable the Eclipse software.
2. Install JDK 6 as prompted:
Download JDK installation from the following official page of Apple:
Http://support.apple.com/kb/DL1572? Viewlocale = en_US
After the installation, java 6 is available by default, and there will be no problems when Eclipse is started.