简体   繁体   English

无法启动 Eclipse - Java 已启动但返回退出代码 = 13

[英]Can't start Eclipse - Java was started but returned exit code=13

I am trying to get my first taste of Android development using Eclipse.我正在尝试使用 Eclipse 第一次体验 Android 开发。 I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.我在尝试运行 Eclipse 时遇到了这个问题,几分钟前才安装了 4.2 版。

After first trying to start Eclipse without any parameters to specify the Java VM, I got an error message saying it couldn't find a Java VM called javaw.exe inside the Eclipse folder , so I found where Java was installed and specified that location as the parameter in the shortcut's target.在第一次尝试在没有任何参数的情况下启动Eclipse来指定 Java VM 后,我收到一条错误消息,说它couldn't find a Java VM called javaw.exe inside the Eclipse folder ,所以我找到了 Java 的安装位置并将该位置指定为快捷方式目标中的参数。 Now I get a different error, Java was started but returned exit code=13 .现在我得到一个不同的错误, Java was started but returned exit code=13

Similar questions seem to indicate that it's a 32-bit/64-bit conflict, but I'm 99% positive that I downloaded 64-bit versions of both Eclipse and Java (RE 7u5) , which I chose because I have 64-bit Windows 7.类似的问题似乎表明这是一个 32 位/64 位冲突,但我 99% 的肯定我下载了 Eclipse 和Java (RE 7u5) 64 位版本,我选择它是因为我有 64 位Windows 7的。

  • If anyone knows how to confirm that my Eclipse and Java are 64-bit, that'd be appreciated.如果有人知道如何确认我的 Eclipse 和 Java 是 64 位的,那将不胜感激。
  • If you think my problem is a different one, please help!如果您认为我的问题不同,请帮助!
  • Please speak as plainly as you can, as I am totally new to Eclipse and Java.请尽可能简单明了,因为我对 Eclipse 和 Java 完全陌生。

Shortcut Target: "C:\\Program Files\\Eclipse-SDK-4.2-win32-x86_64\\eclipse\\eclipse.exe" -vm "C:\\Program Files (x86)\\Java\\jre7\\bin\\javaw.exe"快捷方式目标:"C:\\Program Files\\Eclipse-SDK-4.2-win32-x86_64\\eclipse\\eclipse.exe" -vm "C:\\Program Files (x86)\\Java\\jre7\\bin\\javaw.exe"

Full error code...:完整的错误代码...:

Java was started but returned exit code=13
C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
-os win32
-ws win32
-arch x86_64
-showsplash C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins\org.eclipse.platform_4.2.0.v201206081400\splash.bmp
-launcher C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\eclipse.exe
-name Eclipse
--launcher.library C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v201205221813\eclipse_1503.dll
-startup C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 1e30_5c
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-vmargs
-Xms40m
-Xmx512m
-XX:MaxPermSize=256m
-jar C:\Program Files\Eclipse-SDK-4.2-win32-x86_64\eclipse\\plugins/org.eclipse.equinox.launcher_1.30v20120522-1813.jar

Your version of Eclipse is 64-bit, based on the paths and filenames.根据路径和文件名,您的 Eclipse 版本是 64 位的。 However, the version of Java that it's picking up is 32-bit, as indicated by where it is coming from, on this line:但是,它选择的 Java 版本是 32 位的,如其来源所示,在这一行:

-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe

Program Files (x86) is the folder where 64-bit Windows places 32-bit programs. Program Files (x86)是 64 位 Windows 放置32 位程序的文件夹。

Program Files is the folder where 64-bit Windows places 64-bit programs. Program Files是 64 位 Windows 放置64 位程序的文件夹。

This can happen when a system has more than one JVM installed, as is often the case on Windows 64-bit (for example, the JRE download page uses the bit-ness of the browser to determine what bit-ness download to offer you, and many people use(d) 32-bit browsers even though they run 64-bit Windows).当系统安装了多个 JVM 时就会发生这种情况,这在 64 位 Windows 上经常发生(例如,JRE 下载页面使用浏览器的位数来确定为您提供的位数下载,并且许多人使用 (d) 32 位浏览器,即使他们运行的是 64 位 Windows)。

The best way to fix this, assuming you do in fact have 64-bit JRE or JDK on your system, is to specify in eclipse.ini exactly which JVM you want it to use.解决此问题的最佳方法(假设您的系统上确实有 64 位 JRE 或 JDK)是在eclipse.ini准确指定您希望它使用哪个 JVM。 The instructions are detailed in the Eclipse wiki page , but basically you have to specify the -vm option in the ini file - make sure to read the wiki page carefully as the format is very specific. Eclipse wiki 页面中有详细说明,但基本上您必须在 ini 文件中指定-vm选项 - 请务必仔细阅读 wiki 页面,因为格式非常具体。

Specifying the JVM path in eclipse.ini is strongly recommended because doing so isolates Eclipse from any potential changes to your system PATH that some program installers might make (I'm talking to you, Oracle!).强烈建议在eclipse.ini指定 JVM 路径,因为这样做可以将 Eclipse 与某些程序安装程序可能对您的系统PATH任何潜在更改隔离开来(我是在和您说话,Oracle!)。

Another option would be to download and use 32-bit Eclipse instead of 64-bit, but it's still strongly recommended to specify the path to the JVM in eclipse.ini .另一种选择是下载和使用 32 位 Eclipse 而不是 64 位,但仍然强烈建议在eclipse.ini指定 JVM 的路径。


Left for historical reference :留作历史参考

To check your version of Java, run要检查您的 Java 版本,请运行

java -version

in a console (command prompt).在控制台(命令提示符)中。 On Windows 7 with 64-bit Java 6 I get:在带有 64 位 Java 6 的 Windows 7 上,我得到:

java version "1.6.0_27"
  Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
  Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)

Note the 3rd line, which shows that this is a 64-bit version.注意第三行,它表明这是一个 64 位版本。

On a 32-bit version you'll get something like:在 32 位版本上,你会得到类似的东西:

Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

If you are on a 64-bit machine, then you can install the 64-bit JDK and uninstall the 32-bit one.如果您使用的是 64 位机器,那么您可以安装 64 位 JDK 并卸载 32 位的。 For instance on Windows 10, just go to Settings and under Apps, you will find Java.例如,在 Windows 10 上,只需转到“设置”,然后在“应用”下,您就会找到 Java。 Click on it and you will find all the different versions.单击它,您将找到所有不同的版本。 Now you can select which one to uninstall.现在您可以选择卸载哪一个。

I got this error and found that my PATH variable (on Windows) was probably changed.我收到此错误并发现我的 PATH 变量(在 Windows 上)可能已更改。 First in my PATH was this entry:我的 PATH 中的第一个条目是:

C:\ProgramData\Oracle\Java\javapath

...and Eclipse ran "C:\\ProgramData\\Oracle\\Java\\javapath\\javaw" - which gave the error. ...和 ​​Eclipse 运行"C:\\ProgramData\\Oracle\\Java\\javapath\\javaw" - 这给出了错误。 I suspect that this is something that came along with an installation of Java 8.我怀疑这是安装 Java 8 时附带的。

I have several Java versions installed (6,7 and 8), so I removed that entry from the PATH and tried to restart Eclipse again, which worked fine.我安装了多个 Java 版本(6,7 和 8),因此我从 PATH 中删除了该条目并尝试再次重新启动 Eclipse,这运行良好。

If it's doesn't work for you, you'll need to upgrade your JDK (to the Java versions - 8 in this case).如果它不适合你,你需要升级你的 JDK(在这种情况下升级到 Java 版本 - 8)。

Instructions on how to edit PATH variable有关如何编辑 PATH 变量的说明

There are working combinations of OS, JDK and Eclipse bitness.有操作系统、JDK 和 Eclipse 位数的工作组合。 In my case, I was using a 64-bit JDK with a 32-bit Eclipse on a 64-bit OS.就我而言,我在 64 位操作系统上使用 64 位 JDK 和 32 位 Eclipse。 After downgrading the JDK to 32-bit, Eclipse started working.将 JDK 降级到 32 位后,Eclipse 开始工作。

Use one of the following combinations.使用以下组合之一。

  • 32-bit OS, 32-bit JDK, 32-bit Eclipse (32-bit only) 32 位操作系统、32 位 JDK、32 位 Eclipse(仅限 32 位)
  • 64-bit OS, 32-bit JDK, 32-bit Eclipse 64 位操作系统、32 位 JDK、32 位 Eclipse
  • 64-bit OS, 64-bit JDK, 64-bit Eclipse (64-bit only) 64 位操作系统、64 位 JDK、64 位 Eclipse(仅限 64 位)

如果您最近安装了 Java 8 并卸载了 Java 7,请安装 JDK 8 并重试。

For me the solution was to go into (on Windows 8.1):对我来说,解决方案是进入(在 Windows 8.1 上):

System > Advanced system setting > Environment Variables 

Under 'System variables' in the 'Path' variable there was the following first:在“路径”变量中的“系统变量”下,首先有以下内容:

C:\ProgramData\Oracle\Java\javapath;

I removed this and Eclipse worked again!我删除了它,Eclipse 又开始工作了!

I had the same issue, Java was started but returned exit code=13 .我遇到了同样的问题, Java 已启动但返回 exit code=13

My solution was to create an environment variable to Windows properties variable name = PATH variable value = C:\\Program Files\\Java\\jdk1.7.0_02\\bin , not to C:\\Program Files (x86)\\Java\\jre7\\bin .我的解决方案是为 Windows properties variable name = PATH variable value = C:\\Program Files\\Java\\jdk1.7.0_02\\bin创建一个环境变量,而不是C:\\Program Files (x86)\\Java\\jre7\\bin

Next I added a line to file eclipse.ini → C:\\Program Files\\Java\\jdk1.7.0_02\\bin\\javaw.exe.接下来我在文件eclipse.ini → C:\\Program Files\\Java\\jdk1.7.0_02\\bin\\javaw.exe 中添加了一行。

That worked for me.那对我有用。

在此处输入图片说明

The issue was fixed by doing the following steps.通过执行以下步骤解决了该问题。

  1. Eclipse finds the JAVA executables from 'C:\\ProgramData\\Oracle\\Java\\javapath' Eclipse 从“C:\\ProgramData\\Oracle\\Java\\javapath”中找到 JAVA 可执行文件

  2. The folder structure will contain shortcuts to the below executables,文件夹结构将包含以下可执行文件的快捷方式,
    i.一世。 java.exe执行程序
    ii. ii. javaw.exe执行程序
    iii.三、 javaws.exe执行程序

  3. For me the executable paths were pointing to my Program Files(x86) (home for 32 bit applications) folder location对我来说,可执行路径指向我的Program Files(x86) (32 位应用程序的主页)文件夹位置

  4. I corrected it to Program Files (which homes 64-bit applications) and the issue got resolved我将其更正为Program Files (包含 64 位应用程序),问题得到解决

Please find the screenshot for the same.请找到相同的屏幕截图。

Adding vm argument to .ini file worked for me将 vm 参数添加到 .ini 文件对我有用

-vm
C:\Program Files\Java\jdk1.7.0_65\bin\javaw.exe

The strangest fix ever.有史以来最奇怪的修复。 Look at your Eclipse path, and make sure you do not have strange characters (like ! , # , and @ ).查看您的 Eclipse 路径,并确保您没有奇怪的字符(如!#@ )。 It worked for me.它对我有用。

Locate eclipse.ini:找到 eclipse.ini:

Often at C:\\Users\\xxx\\eclipse\\jee-neon\\eclipse , add通常在C:\\Users\\xxx\\eclipse\\jee-neon\\eclipse ,添加

-vm
 C:\Program Files (x86)\Java\jre7\bin\javaw.exe

after

--launcher.appendVmargs

我卸载了 Java 更新 25,问题解决了。

A clean reinstall of the Java JDK did the trick in my case.在我的情况下,干净地重新安装Java JDK 可以解决问题 I am running Eclipse 4.4 (Luna) like a charm now.我现在像魅力一样运行Eclipse 4.4 (Luna)。

You have to go to the folder where eclipse is installed and then you have to change the eclipse.ini file.您必须转到安装 eclipse 的文件夹,然后您必须更改 eclipse.ini 文件。

You have to add你必须添加

-vm -vm

C:\\Program Files\\Java\\jdk1.8.0_202\\bin\\javaw.exe C:\\Program Files\\Java\\jdk1.8.0_202\\bin\\javaw.exe

Your eclipse.ini file will look like the below screenshot您的 eclipse.ini 文件将类似于以下屏幕截图

在此处输入图片说明

The solution is simple: Put the "eclipse" folder on "C:/Program Files".解决方案很简单:将“eclipse”文件夹放在“C:/Program Files”上。 If it does not work, put it in "C:/Program Files (x86)".如果它不起作用,请将其放入“C:/Program Files (x86)”。

It turned out I only had the 32-bit Java runtime installed.结果我只安装了 32 位 Java 运行时。

C:\Program Files (x86)\Java\jre1.8.0_45\

All Eclipse really wanted was for me to install the 64-bit Java runtime. Eclipse 真正想要的是让我安装 64 位 Java 运行时。 <= SOLVED <= 已解决

Java SE Runtime Environment 8u45  jdk-8u45-windows-x64.exe

http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

Confirm your installation by checking you now have this folder

    C:\Program Files\Java\jre1.8.0_45\

The best answer here is too long.这里的最佳答案太长了。 I cannot comment so I added my answer.我无法发表评论,所以我添加了我的答案。

  1. Go here: http://www.oracle.com/technetwork/java/javase/downloads/index.html去这里: http : //www.oracle.com/technetwork/java/javase/downloads/index.html
  2. Download the latest SDK (of course for x64 if your computer is x64)下载最新的 SDK(如果您的计算机是 x64,当然适用于 x64)
  3. Install it安装它
  4. Now the party is finished, and it's time to work with Eclipse ;)现在派对已经结束,是时候使用 Eclipse 了 ;)

当我忘记安装 JDK 时,我收到了这条消息。

I had the same problem.我有同样的问题。 I was using Windows 8 with a 64-bit OS.我使用的是带有 64 位操作系统的 Windows 8。 I just changed the path to Program Files (x86) and then it started work.我只是将路径更改为Program Files (x86) ,然后它开始工作。 I put this line in the eclipse.ini file:我把这一行放在 eclipse.ini 文件中:

-vm
 C:\Program Files (x86)\Java\jre7\bin\javaw.exe

确保 Eclipse 路径中没有特殊字符( %$#等)。

If you install a 64-bit Eclipse version on a PC with a 32-bit JRE this is guaranteed to occur.如果您在具有 32 位 JRE 的 PC 上安装 64 位 Eclipse 版本,这肯定会发生。

So the solution is quite straightforward: You need to synchronise them by updating either one.因此,解决方案非常简单:您需要通过更新任何一个来同步它们。 This shall happen when downloading Oracle Fusion middleware and Eclipse expects a 32-bit environment while your JRE is 64-bit and your JAVA home is pointing to a 64-bit JDK.下载 Oracle Fusion 中间件时会发生这种情况,Eclipse 需要 32 位环境,而您的 JRE 是 64 位,而您的 JAVA 主页指向 64 位 JDK。

  1. Under system environment variables, make sure "C:\\ProgramData\\Oracle\\Java\\javapath" is removed.在系统环境变量下,确保删除了“C:\\ProgramData\\Oracle\\Java\\javapath”。

  2. Under system environment variables, make sure "C:\\Program Files\\Java\\jdk1.8.0_131\\bin" is added.在系统环境变量下,确保添加了“C:\\Program Files\\Java\\jdk1.8.0_131\\bin”。

在此处输入图片说明

I tried some of the solutions, but not worked for me.我尝试了一些解决方案,但对我不起作用。

Finally, I found another way, ...终于,我找到了另一种方法,...

Go to Environment VariablesSystem Variables转到环境变量系统变量

Set C:\\Program Files\\Java\\jdk1.7.0_02\\bin\\javaw.exe to the path in the system variables.C:\\Program Files\\Java\\jdk1.7.0_02\\bin\\javaw.exe设置为系统变量中的路径。

Try it.尝试一下。 It worked for me...它对我有用...

I tried the following solution:我尝试了以下解决方案:

I created a shortcut of javaw.exe from path C:\\Program Files\\Java\\jdk1.7.0_71\\bin and pasted it into the path C:\\ProgramData\\Oracle\\Java\\javapath .我从路径C:\\Program Files\\Java\\jdk1.7.0_71\\bin创建了 javaw.exe 的快捷方式,并将其粘贴到路径C:\\ProgramData\\Oracle\\Java\\javapath 中

After that, I launched Eclipse, and it worked for me.之后,我启动了 Eclipse,它对我有用。

I had this issue.我有这个问题。 I installed Java 8 update 25 via Chrome, and therafter attempting to start Eclipse gave the mentioned error.我通过 Chrome 安装了 Java 8 update 25,之后尝试启动 Eclipse 出现了上述错误。

Uninstalled that update, and Eclipse works again.卸载该更新,Eclipse 再次运行。

I also encountered the same issue.我也遇到了同样的问题。 It turned out that the environment variable Path was pointing to an incorrect Java version.事实证明,环境变量Path指向了不正确的 Java 版本。

Please check the environment variable and point it to the correct Java.请检查环境变量并将其指向正确的 Java。 For example:例如:

C:\Program Files (x86)\Java\jdk1.6.0_17\bin

To check the environment variable, go to:要检查环境变量,请转到:

Computer → properties → Advanced system settings → Advanced -> Environment variables

It could be due to too little memory.可能是内存太少。 You can modify the eclipse.ini file to increase the memory.您可以修改 eclipse.ini 文件以增加内存。 Something like this might help you: FAQ How do I increase the heap size available to Eclipse?这样的事情可能对您有所帮助: 常见问题解答如何增加 Eclipse 可用的堆大小?

I have just solved the same issue upon setting up my Windows 8.1 PC.我刚刚在设置 Windows 8.1 PC 时解决了同样的问题。 Exactly like @George Papatheodorou mentioned above (sorry I cannot add a comment), Eclipse and JRE must be both 64 bit or 32 bit.就像上面提到的@George Papatheodorou(对不起,我不能添加评论)一样,Eclipse 和 JRE 必须都是 64 位或 32 位。

However, it seems for Windows 8/8.1 environment, you are going to get 32-bit JRE by default (and I do not know where to change that default for the download), as explained here: http://java.com/en/download/faq/win8_faq.xml但是,似乎对于 Windows 8/8.1 环境,默认情况下您将获得 32 位 JRE(并且我不知道在哪里更改下载的默认值),如下所述: http : //java.com/ en/download/faq/win8_faq.xml

I was using 64-bit Eclipse so there was a discrepancy.我使用的是 64 位 Eclipse,因此存在差异。 I then installed 32-bit Eclipse and everything works fine this time.然后我安装了 32 位 Eclipse,这次一切正常。

So before bothering changing any environment variables, check your JRE and Eclipse version.因此,在更改任何环境变量之前,请检查您的 JRE 和 Eclipse 版本。

Of course you can use 64-bit JRE with 64-bit Eclipse.当然,您可以在 64 位 Eclipse 中使用 64 位 JRE。 Just make sure they match because Windows 8.1 will give you 32-bit by default.只需确保它们匹配即可,因为 Windows 8.1 默认为您提供 32 位。

I had a similar error after installing Java 8 on my Windows 7 system, 64 bit system.在我的 Windows 7 系统,64 位系统上安装 Java 8 后,我遇到了类似的错误。

Changing environment variables, etc. did not help.更改环境变量等没有帮助。 So I tried to remove the Java Update 8, but that too did not help.所以我试图删除 Java Update 8,但这也无济于事。 Downloading and installing the 64-bit version of Java 8 SDK fixed my problem.下载并安装 64 位版本的 Java 8 SDK 解决了我的问题。 I hope this helps.我希望这有帮助。

I had the same issue after I upgraded my JDK from 1.7 to 1.8.将 JDK 从 1.7 升级到 1.8 后,我遇到了同样的问题。 I'm using Eclipse 4.4 (Luna).我正在使用 Eclipse 4.4 (Luna)。 The error is gone after I degrade JDK to 1.7.在我将 JDK 降级到 1.7 后,错误消失了。

Please check whether you have set two JAVA paths in the Environment Variable section.请检查您是否在环境变量部分设置了两个 JAVA 路径。 If you already installed two versions of the JDK, it might be, then double check you have put PATH for Java like below.如果您已经安装了两个版本的 JDK,可能是这样,然后仔细检查您是否已将 PATH 设置为 Java,如下所示。

PATH -->  C:\ProgramData\Oracle\Java\javapath

and also并且

JAVA_HOME ---> C:\Program Files\Java\jdk1.7.0_02\bin

If both are there, then this sort of error may occur.如果两者都存在,则可能会出现此类错误。

If it's OK, then check in the ".ini" file the below area is OK or not.如果没问题,然后检查“.ini”文件下面的区域是否正常。 Open ".ini" file and check打开“.ini”文件并检查

 -VM  path is  C:\Program Files\Java\jdk1.7.0_79\bin\

If not, please set it like that and run again.如果没有,请设置它并再次运行。

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

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