如何让OSX上的Eclipse使用Java 1.6?

时间:2023-01-25 09:00:16

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.

我刚刚在我的OSX上安装了Java 1.6,除了Eclipse拒绝启动外,一切都运行良好。它提出了一个巨大的提示,我无法复制/粘贴,但它明确表示它想要使用Java 1.5并且再也找不到它了。

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

我在配置文件中没有看到它应该查找哪个版本的Java。有没有人处理过这个?

Thanks in advance.

提前致谢。

3 个解决方案

#1


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

在/Applications/Eclipse/Eclipse.app上右键单击并选择“显示包内容”,打开Contents / Info.plist,使用文本编辑器NOT plist editor

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

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

to

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

save it and restart.

保存并重新启动。

#2


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.

除非我弄错了,Mac上的Java 1.6 vm只有64位。要使用它,您需要一个64位版本的Eclipse。 Mac上唯一的64位eclipse端口是新的可可构建,在这里找到它。

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.

几个星期后,Galileo发布将完成,你可以通过Eclipse Classic - > Other Downloads找到64位可可端口。

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

如果你想保持当前的eclipse安装,你必须按照其他答案的建议去做,并将它们改为使用1.5

#3


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

您应切换到以前版本的Java,在Utilities,Java Preferences下,并将1.5 32 bit作为第一选择。

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

出错的原因是捆绑的SWT JINI库似乎只针对某些平台进行编译。

You can always check the Console for specific error messages.

您始终可以在控制台中查看特定的错误消息。

#1


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

在/Applications/Eclipse/Eclipse.app上右键单击并选择“显示包内容”,打开Contents / Info.plist,使用文本编辑器NOT plist editor

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

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

to

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

save it and restart.

保存并重新启动。

#2


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.

除非我弄错了,Mac上的Java 1.6 vm只有64位。要使用它,您需要一个64位版本的Eclipse。 Mac上唯一的64位eclipse端口是新的可可构建,在这里找到它。

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.

几个星期后,Galileo发布将完成,你可以通过Eclipse Classic - > Other Downloads找到64位可可端口。

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

如果你想保持当前的eclipse安装,你必须按照其他答案的建议去做,并将它们改为使用1.5

#3


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

您应切换到以前版本的Java,在Utilities,Java Preferences下,并将1.5 32 bit作为第一选择。

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

出错的原因是捆绑的SWT JINI库似乎只针对某些平台进行编译。

You can always check the Console for specific error messages.

您始终可以在控制台中查看特定的错误消息。