How can I get Eclipse on OSX to use Java 1.6?

2019-07-10 20:04发布

I just installed Java 1.6 on my OSX and everything works brilliantly, except that Eclipse refuses to start. It puts up a huge prompt from which I can't copy/paste, but it's clearly stating that it wants to be using Java 1.5 and can't find it anymore.

I don't see anything in its configuration files about which version of Java it should be looking for. Has anyone dealt with this?

Thanks in advance.

3条回答
再贱就再见
2楼-- · 2019-07-10 20:10

Unless I'm mistaken, the Java 1.6 vm on the Mac is 64 bit only. To use it, you'll need a 64bit version of Eclipse. The only 64bit port of eclipse on the mac is the new cocoa build, find it here.

In a few weeks, the Galileo release will be finished, there you can find the 64 bit cocoa port by going to Eclipse Classic -> Other Downloads.

If you want to keep your current eclipse install, you'll have to do as the other answers suggest and change them to use 1.5

查看更多
Rolldiameter
3楼-- · 2019-07-10 20:21

You should switch to your previous version of Java, under Utilities, Java Preferences, and dragging 1.5 32 bit as the first choice.

The reason for the error is that the bundled SWT JINI libraries seem to be compiled for only certain platforms.

You can always check the Console for specific error messages.

查看更多
等我变得足够好
4楼-- · 2019-07-10 20:30

on /Applications/Eclipse/Eclipse.app right click and choose "Show Package Contents" open Contents/Info.plist with a text editor NOT plist editor

add <string>-vm</string> <string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>

to

<key>Eclipse</key>
        <array>
<!-- add it here -->
</array>

save it and restart.

查看更多
登录 后发表回答