Java _ Java 0010 _ What should I do if I cannot open eclipse in Mac environment?

Source: Internet
Author: User
Tags java se

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.