Eclipse on Mac 10.8 - Installed 1.7.0 JRE / JDK, b

2020-02-08 11:12发布

  • Installed Java SE 1.7.0u10 from Oracle w/ their installer package

  • Downloaded and unpacked Eclipse Juno (4.2.1)

  • Double click Eclipse purple icon and get OS X alert prompt with error message:

To open "Eclipse," you need a Java SE 6 runtime. Would you like to install one now?

  • (in terminal) which java - /usr/bin/java

  • ls -l /usr/bin/java - /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

  • (in Finder) Double click eclipse alias (included when unpacked download) - Terminal launches, /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse ; exit ; and Exclipse launches without OS X alert prompt.

I've tried modifying the Eclipse app bundle plist to point the -vm key to /System/Library/Frameworks/JavaVM.frameworks/Versions/Current/Commands/java, but I feel like I probably shouldn't have to do this.`

I'd like to know how to get Eclipse to launch by just double clicking on the Application package. It's such a small thing to bug me... :o)

18条回答
我想做一个坏孩纸
2楼-- · 2020-02-08 11:29

The best answer is to fix the Java 7 installation as shown here : https://stackoverflow.com/a/19594116
Simple to do and I have confirmed it works on Mavericks. With this fix, you can launch your app from the launchpad as usual. If you upgrade your JDK, you will have to reapply the fix to the new installation.

查看更多
Ridiculous、
3楼-- · 2020-02-08 11:29

If you'd like to install Java 6 JDK only (no Java 7 JDK/JRE, no Java 6 JRE only), install the Apple OSX Java DMG (at time of writing, this was http://adcdownload.apple.com/Developer_Tools/java_for_os_x_2013003_developer_package/java_for_os_x_2013003_dp__11m4406.dmg).

You still won't be able to start Eclipse. Make a directory JavaVirtualMachines under /System/Library/Java. And then make an Alias of the java version folder at /Library/Java/JavaVirtualMachines and rename the alias 1.6.0.jdk and copy that alias to /System/Library/Java/JavaVirtualMachines/

After finished, you will have an Alias at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk that points to the Java install directory at */Library/Java/JavaVirtualMachines/1.6.0_XX-XXX-XXX.jdk*

查看更多
何必那么认真
4楼-- · 2020-02-08 11:29

How to Make Eclipse Run on OS X 10.9 Mavericks

Attempting to launch various Eclipse versions after the Mavericks upgrade pops up a dialog with this message:

To open "Eclipse.app" you need a Java SE 6 runtime. Would you like to install one now?

enter image description here

It turns out that Java 7 is disabled by default in OS X 10.9.
This is easily verified as follows:

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

The solution is to install the latest supported Java version from Apple support: Java for OS X 2013-005 (http://support.apple.com/kb/DL1572)
As of 10/15/13 this would be Java SE 6 1.6.0_65.
Post Date: Oct 15, 2013
File Size: 63.98 MB

After the install, Eclipse will run as expected from the Dock, the Finder, or the Terminal without any tricks, hacks, or work-arounds.

查看更多
欢心
5楼-- · 2020-02-08 11:29

I had this problem and found that I did not have JDK installed on my Mac. Once I did that, Eclipse starts normally.

查看更多
男人必须洒脱
6楼-- · 2020-02-08 11:30

I found the answer over on Ask Different

It's an ugly hack, but works perfectly.

查看更多
Rolldiameter
7楼-- · 2020-02-08 11:31

I found the same problem (Mac OS X 10.9.2, Java 1.7.0_53b13, Eclipse Kepler). The workaround was quite easy:

  1. Find the executable in Finder (CMD+Click on Eclipse's icon in the Dock)
  2. Remove the icon from the Dock
  3. CTRL+Click on the executable in Finder
  4. ALT+Open (to allow the execution of a non-signed application)
  5. Eclipse opens normally and without any problem
  6. Re-dragged the program onto the Dock
查看更多
登录 后发表回答