我只是追加 虚拟机 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

谢谢你!


当前回答

我也有这个问题。我有一个旧的JDK1.8.0_05。我安装了最新的JDK1.8.0_111,现在一切都很好。一定要更新环境变量。

我用的是64位的Windows 7。 使用Eclipse Neon 1a。

希望这能帮助到别人。

其他回答

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

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

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

我尝试了很多方法,并将-VM参数放在建议的位置。但这行不通。最后我找到了解决办法。在执行任何插件或jar之前,vm args应该放在eclipse.ini文件中。我尝试了ubuntu 18.04中最新的eclipse [Photon],它非常适合我。

-startup
-vm        
/usr/local/java/jdk1.8.0_251/bin/java.exe
plugins/org.eclipse.equinox.launcher_1.5.700.v20200207-2156.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM

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

Eclipse:

在eclipse.ini中添加了这两行

第二行表示javaw.exe文件的JDK位置。

虚拟机 C:\Program Files\Java\ jdk1.7.0_60 \ bin \ javaw.exe

注意:将-vm行放在-vmargs之前,否则采用默认位置。

为STS

在STS.ini中进行如上更改

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.