Edit $ECLIPSE _home/Eclipse. app/contents/MacOs/eclipse.ini file, right or CTRL + click on the eclipse application in the Finder, then click "Show Package Contents" and go to directory contents/macos/to find
by ls-ltr/library/Java/javaVirtualmachines/lists the installed individualJDK versionpath, and then specify it in the Eclipse.ini file, for example:
-VM
/library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home/bin/java
the system default is
/system/library/frameworks/javavm.framework/versions/current/commands/java
at the same time, you can see all the java_home points by executing/usr/libexec/java_home-v, for example:
Matching Java Virtual Machines (5):
1.8.0_25, x86_64: "Java SE 8"/library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home
1.8.0_20, x86_64: "Java SE 8"/library/java/javavirtualmachines/jdk1.8.0_20.jdk/contents/home
1.7.0_71, x86_64: "Java SE 7"/library/java/javavirtualmachines/jdk1.7.0_71.jdk/contents/home
1.6.0_65-b14-466.1, x86_64: "Java SE 6"/system/library/java/javavirtualmachines/1.6.0.jdk/contents/home
1.6.0_65-b14-466.1, i386: "Java SE 6"/system/library/java/javavirtualmachines/1.6.0.jdk/contents/home
/library/java/javavirtualmachines/jdk1.8.0_25.jdk/contents/home
ls-ltr/usr/libexec/java_home displaying file information
How do I specify a version of the JDK on Mac OS x that is specified when eclipse starts?