Eclipse:Java 已启动但返回错误代码=13

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27019786/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 03:40:44  来源:igfitidea点击:

Eclipse: Java was started but returned error code=13

javaeclipse

提问by chif-ii

I just updated Java to 1.8 u25, and now I get this message every time I try to open Eclipse

我刚刚将 Java 更新为 1.8 u25,现在每次尝试打开 Eclipse 时都会收到此消息

enter image description here

在此处输入图片说明

I have no clue what I'm doing wrong, when it comes to Eclipse. I have re-downloaded it number of times but still cannot get it to work. How could I fix this?

当谈到 Eclipse 时,我不知道我做错了什么。我已经重新下载了很多次,但仍然无法正常工作。我怎么能解决这个问题?

This is my eclipse.ini file

这是我的 eclipse.ini 文件

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files (x86)\Java\jdk1.8.0_25\jre\bin
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms40m
-Xmx512m

采纳答案by Sergey Morozov

This error occurs because your Eclipse version is 64-bit. You should download and install 64-bit JRE and add the path to it in eclipse.ini. For example:

发生此错误是因为您的 Eclipse 版本是 64 位。您应该下载并安装 64 位 JRE 并在eclipse.ini. 例如:

...
--launcher.appendVmargs
-vm
C:\Program Files\Java\jre1.8.0_45\bin\javaw.exe
-vmargs
...

Note:The -vmparameter should be just before -vmargsand the path should be on a separate line. It should be the full path to the javaw.exefile. Do not enclose the path in double quotes (").

注:-vm参数应该是之前-vmargs和路径应该是一个独立的行。它应该是javaw.exe文件的完整路径。不要用双引号 ( ")将路径括起来。

If your Eclipse is 32-bit, install a 32-bit JRE and use the path to its javaw.exefile.

如果您的 Eclipse 是 32 位,请安装 32 位 JRE 并使用其javaw.exe文件的路径。

回答by hfontanez

This is often caused by the (accidental) removal of the JRE folder that is set in the Eclipse configuration. You can try following these instructions from the Eclipse wikion how to configure the eclipse.inifile to include the the JRE location, or alternatively, launch eclipse from the command prompt using VM arguments. I have tried them both myself and in my opinion, the command prompt option works much better.

这通常是由(意外)删除 Eclipse 配置中设置的 JRE 文件夹引起的。您可以尝试按照Eclipse wiki 中的这些说明操作,了解如何配置eclipse.ini文件以包含 JRE 位置,或者使用 VM 参数从命令提示符启动 eclipse。我自己都尝试过,在我看来,命令提示符选项效果更好。

Once you are able to launch Eclipse, make sure you verify the installed JRE location under Java--> Installed JREsin the Preferenceswindow.

一旦您能够启动 Eclipse,请确保您在Preferences窗口中的Java--> Installed JREs下验证已安装的 JRE 位置。

回答by Adheep Mohamed Abdul Kader

Since you didn't mention the version of Eclipse, I advice you to download the latest version of Eclipse Lunawhich comes with Java 8 support by default.

由于您没有提到Eclipse的版本,我建议您下载Eclipse Luna默认支持Java 8的最新版本。

回答by Vito Sebastiani

This is caused when java is updated. You have to delete in environement path : C:**ProgramData\Oracle\Java\javapath**

这是在更新java 时引起的。您必须在环境路径中删除:C:**ProgramData\Oracle\Java\javapath**

回答by Svend Hansen

Like Vito mentions, this error occurs after Java updates as the path:

就像 Vito 提到的,这个错误发生在 Java 更新为路径之后:

C:\ProgramData\Oracle\Java\javapath

is added to the Pathenvironment variable, causing Eclipse to run using the wrong java version.

被添加到Path环境变量中,导致 Eclipse 使用错误的 Java 版本运行。

To fix the problem:

要解决问题:

1) Right-click on Computerand choose Properties.

1) 右键单击Computer并选择Properties

2) Click Advanced system settings

2)点击 Advanced system settings

3) Click Environment Variables...

3) 点击 Environment Variables...

4) Find the Pathvariable in the System variablessection.

4)PathSystem variables节中找到变量。

5) Choose it and click Edit...

5)选择它并单击 Edit...

6) Find and delete the above mentioned path.

6) 找到并删除上述路径。

This fixed it for me. I should mention that I already have the path:

这为我修好了。我应该提到我已经有了路径:

c:\Program Files\Java\jdk1.7.0_21\bin

in the Pathvariable, but the new path was added to the beginning of the Pathvariable and therefore resolution would use that path first.

Path变量中,但新路径已添加到Path变量的开头,因此解析将首先使用该路径。

回答by Gaurav vijayvargiya

I also faced the error code when i upgraded my java version to 1.8. The problem was with my eclipse.

当我将 Java 版本升级到 1.8 时,我也遇到了错误代码。问题出在我的日食上。

My jdk which was installed on my system is of 32 - bit and my eclipse was of 64 - bit.

我的系统上安装的 jdk 是 32 位的,而我的 eclipse 是 64 位的。

So solve this problem i downloaded the 32 - bit eclipse.

所以解决这个问题我下载了32位的eclipse。

IMO this Architecture miss match problem

IMO 此架构未命中匹配问题

Plese match your architecture type of JDK and eclipse.

请匹配您的 JDK 和 eclipse 的架构类型。

回答by alvaro

My solution: Because all others did not work for me. I deleted the symlinks at C:\ProgramData\Oracle\Java\javapath. this makes eclipse to run with the jre declared in the PATH. This is better for me because I want to develop Java with the JRE I chose, not the system JRE. Often you want to develop with older versions and such

我的解决方案:因为所有其他人都不适合我。我删除了 C:\ProgramData\Oracle\Java\javapath 中的符号链接。这使得 eclipse 与在 PATH 中声明的 jre 一起运行。这对我来说更好,因为我想用我选择的 JRE 来开发 Java,而不是系统 JRE。通常您想使用旧版本等进行开发