To open “Eclipse” you need to install the legacy Java SE 6 runtime

匿名 (未验证) 提交于 2019-12-03 02:44:02

问题:

Just installed a fresh version of Kepler 64bit "for Java Developers" on Yosemite, getting this error on first launch. Any thoughts on how to fix? Really do not want to downgrade my Java version!

回答1:

I just encountered this in another Eclipse-based app on Yosemite and figured out (with help from the references below) how to get the app running without installing the legacy Java SE 6 JRE. Here are the steps in case it helps other devs get Eclipse working.

PRECONDITIONS

$ sw_vers -productVersion  10.10.1 $ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) 

Other configurations might work; this is my environment.

STEPS

  1. Edit the info.plist for the JDK after installing:

    $ sudo nano `/usr/libexec/java_home -V`/../info.plist 
  2. Change the following section:

    <key>JVMCapabilities</key>  <array>   <string>CommandLine</string>  </array>  

    to

    <key>JVMCapabilities</key>  <array>   <string>JNI</string>   <string>BundledApp</string>   <string>WebStart</string>   <string>Applets</string>   <string>CommandLine</string>  </array> 
  3. Try to open the app from the command-line (not sure if this is strictly necessary, but what I did)

    You should get an error "(app) can't be opened because it is from an unidentified developer."

  4. Go to System Preferences: Security Settings (General) and you should see the recent app next to a button "Open Anyway" -- click this button to open the app.

This opens Eclipse without requiring the separate download of the legacy Java SE 6 files.

NOTES

When I was solving this on MTGBrowser (below) I also followed advice to change the info.plist of the app by adding the following section to the 'Eclipse' key:

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java</string> 

However, I'm not sure that's strictly required. In any case, that wasn't sufficient -- I also had to change the JDK info.plist and security as described above for a complete solution.

REFERENCES



回答2:

I was facing this trouble for hours. I followed every suggestion I could find over numerous forums with no success. I resolved the issue by simply installing 1.8.x JDK instead of the JRE, despite having no intension to develop for Java. I guess eclipse requires this.



回答3:

I ended up relenting and downloading Java 6 from here:

http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US

Apparently this seems to coexist ok with the latest Java version which I also installed (version 8 update 25) and version 8 shows up as the version I'm running when I verify from

https://www.java.com/en/download/installed.jsp

I'm unclear on the security implications of this though, would have preferred another solution, if anyone finds a better solution than installing 6 please let me know.



回答4:

I received this error while installing Eclipse on a fresh MacBook with macOS Sierra, version 10.12.3, which apparently does not have ANY java installed. I made the problem go away by installing java version 1.8 JDK and then had no trouble installing Eclipse after.

i.e. before installing

MacBook-Pro:$ java -version No Java runtime present, requesting install. 

and after installing

MacBook-Pro:$ java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) 

tldr; This error may indicate you don't have Java, and you can fix by installing the latest version of Java instead of the "legacy" version



回答5:

I had JDK 7 installed on Yosemite, and upgrading Eclipse to Luna fixed this issue for me



回答6:

My Mac crashed and after the restart I had the same issue. Turned out that for some reason the file /usr/libexec/java_home was missing. After symlinking it to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home, Eclipse now starts without any complains.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!