简体   繁体   English

如何强制Eclipse使用Sun Java?

[英]How can I force Eclipse to use Sun Java?

Before installing Eclipse, I had OpenJDK as the default JVM. 在安装Eclipse之前,我将OpenJDK作为默认的JVM。 Recently I changed it to Sun Java. 最近我把它改成了Sun Java。

I did this because Eclipse Helios was running really slow. 我这样做是因为Eclipse Helios的运行速度非常慢。 Unfortunately, it is still slow... Do you have any ideas how to force it to use Sun Java? 不幸的是,它仍然很慢......你有任何想法如何强迫它使用Sun Java?

I could reinstall Eclipse, however I have already installed the Android SDK, so I would have to install that again. 我可以重新安装Eclipse,但是我已经安装了Android SDK,所以我必须再次安装它。 After all, I don't think that's the correct way of solving the problem. 毕竟,我认为这不是解决问题的正确方法。 I'm using Ubuntu 10.10. 我正在使用Ubuntu 10.10。

$ java -version  
java version "1.6.0_22" 
Java(TM) SE Runtime Environment (build1.6.0_22-b04) 
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)

I would be grateful for any help. 我将不胜感激任何帮助。

Edit $ECLIPSE_HOME/eclipse.ini and add the following before the vmargs option. 编辑$ECLIPSE_HOME/eclipse.ini并在vmargs选项之前添加以下内容。

-vm
/opt/path/to/sun-jdk-1.6.0.02/bin/java

You can tell Eclipse which VM to use using -vm command line args. 您可以使用-vm命令行参数告诉Eclipse使用哪个VM。

See Eclipse wiki for example usage 有关示例用法,请参阅Eclipse wiki

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM