我只是追加 虚拟机 C:\Program Files\Java\jre6\bin\javaw.exe

在eclipse.ini中,然后我尝试再次启动eclipse,并得到这个错误。告诉我怎么解或者链接能解出来。

这是eclipse。ini

-startup 
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
 --launcher.library
 plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810 
-showsplash
 org.eclipse.platform
--launcher.XXMaxPermSize 256m 
--launcher.defaultAction 
openFile 
-vm 
C:\Program Files\Java\jre6\bin\javaw.exe
-vmargs 
-Xms40m 
-Xmx384m

谢谢你!


当前回答

In my opinion the most answers here regarding different architectures of Eclipse and Java are simply wrong and this can be easily checked using e.g. Process Monitor under Windows. The -vm option is there to run a specific version of java and the point of it is, that the configured process is started and runs all the Java code on its own, that's why you configure up to java.exe. In that case you DON'T need to have the same architecture for Eclipse and Java, but can happily mix both 32 Bit and 64 Bit. You only CAN'T mix both, if you DON'T use -vm, but let Eclipse load Java natively into its own process using jvm.dll and such. That latter behavior is Eclipse's default, but not the case anymore if you properly configure -vm in eclipse.ini.

如果你不相信我,你可以自己用Eclipse和Java的不同体系结构做一些测试,并正确地配置-vm。最后,这正是提问者在对公认答案的评论中所描述的:

不能运行Eclipse;JVM终止。退出代码= 13

他说64位JDK现在正在工作,但在他的截图中可以看到他的Eclipse是32位的,因为启动器的路径。库是32位的。

And now for the reason I came here: Ony of my customers had some problems loading one of our Eclipse/OSGI based applications as well and Java exited with exit code 13. In the end it showed that the problem was not about -vm or the architectures of Java and eclipse.exe, but instead he was simply missing config.ini and I guess eclipse.exe wasn't aware what to load or such. After we recognized that and put a config.iniback in place, the app loaded fine with using -vm and a 64 Bit JRE7 in combination with a 32 Bit eclipse.exe.

其他回答

在java更新后,eclipse将无法启动,因为默认的jdk位置已经更改。向eclipse.ini文件中添加以下行立即解决了我的问题:

-vm
C:\Program Files (x86)\Java\jdk1.7.0_75\bin\javaw.exe

我在vmargs之前添加了这些行。如下图所示:

...
--launcher.defaultAction
openFile
-vm
C:\Program Files (x86)\Java\jdk1.7.0_75\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

有关eclipse.ini的更多信息,请访问http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example

在我的情况下,我使用32位eclipse和java。如果同时安装了32位和64位版本的java,请谨慎选择正确的版本。对于64位版本,请参考该目录下的javaw.exe文件

C:\Program Files\Java\jdk1.8.0_60\bin

我刚刚也碰到了这个。结果证明,至少对我来说,这是因为尝试使用win32 Eclipse的win64版本的JRE。我认为win32 Eclipse需要win32 Java(在Oracle/Sun的Java安装程序列表中称为-586)。

我同时使用这两个工具的原因是,我试图找出一个只在64位Eclipse中出现的错误,所以我需要一个32位的Eclipse来进行比较。

一旦我在我的机器上安装了“x64”(win64)和“i586”(win32)版本的JRE,一切都很好,没有错误13。显然你可以同时安装两个。

这可能只是错误显示的方式(而不是在eclipse.ini文件中如何编写),但是在eclipse.ini(指定JVM)中有文本说以下内容:

选项-vm和它的值(路径)必须在不同的行上。 该值必须是Java可执行文件的完整绝对路径,而不仅仅是Java主目录。 -vm选项必须出现在-vmargs选项之前,因为-vmargs之后的所有内容都将直接传递给JVM

转到您保存Eclipse的文件夹。查看启动日志中的配置文件夹。它会给你一个比“退出代码13”更好的诊断。

使用Eclipse Neon的人

我想运行Eclipse Neon, JRE 1.8但是JDK 1.7 返回error=13 然后我安装了java JDK 1.8,一切都很顺利