Java _ Java 0010 _ What should I do if I cannot open eclipse in Mac environment?
What if eclipse cannot be opened in Mac environment?
It is very likely that eclipse (what is Eclipse: What tools should be used for java Development) does not specify the jdk version (how to install Jdk: how to install and configure Jdk) path, jdk cannot be loaded at startup, causing crash. Let's talk about the solution.
1. Open the $ ECLIPSE_HOME/Eclipse. app/Contents/MacOS/eclipse. ini file:
Right-click the Eclipse application in the Finder or press Ctrl +, and then click "show Package content" To Go To The Contents/MacOS/directory.
2. Use ls-ltr/Library/Java/JavaVirtualMachines/to list the paths of installed JDK versions, and specify the paths in the eclipse. ini file. For example:
-vm/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java
The default value is:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
The following method is provided for querying the point pointed to by JAVA_HOME:
/usr/libexec/java_home -V
You can view where all JAVA_HOME points:
Matching Java Virtual Machines (4):1.8.0_40, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home1.7.0_79, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home1.6.0_65-b14-468, x86_64: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home1.6.0_65-b14-468, i386: "Java SE 6" /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
The file information is displayed as follows:
ls -ltr /usr/libexec/java_home
Result:
lrwxr-xr-x 1 root wheel 79 12 30 10:36 /usr/libexec/java_home -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home