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

I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.

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. Now I get a different error, "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.

  • If anyone knows how to confirm that my Eclipse and Java are 64-bit, that'd be appreciated.
  • 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.

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"

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

转载于:https://stackoverflow.com/questions/11461607/cant-start-eclipse-java-was-started-but-returned-exit-code-13

weixin_41568183
零零乙 select that error message and use shortcut - Ctrl + C. It will get copied.
3 年多之前 回复
csdnceshi80
胖鸭 How the hell did you access the error message text? On my PC it can't be copied, I had to type it on the keyboard...
大约 5 年之前 回复
weixin_41568126
乱世@小熊 See also stackoverflow.com/questions/4945178/… and stackoverflow.com/questions/6166795/… and stackoverflow.com/questions/8230853/…
8 年多之前 回复
csdnceshi50
三生石@ "Program Files (x86)" is where Windows tends to put 32-bit stuff these days. I'm not sure exactly how to check your java version, but you can always uninstall and download it fresh.
8 年多之前 回复

29个回答

There are working combinations of OS, JDK and Eclipse bitness. In my case, I was using a 64-bit JDK with a 32-bit Eclipse on a 64-bit OS. After downgrading the JDK to 32-bit, Eclipse started working.

Kindly use one of the following combinations.

  • 32-bit OS, 32-bit JDK, 32-bit Eclipse (32-bit only)
  • 64-bit OS, 32-bit JDK, 32-bit Eclipse
  • 64-bit OS, 64-bit JDK, 64-bit Eclipse (64-bit only)
csdnceshi50
三生石@ Thanks, it works.
大约 2 年之前 回复
csdnceshi65
larry*wei Thanks, I just uninstalled 32 bit JRE and that fixed.
2 年多之前 回复

I got this error and found that my PATH variable (on Windows) was probably changed. First in my PATH was this entry:

C:\ProgramData\Oracle\Java\javapath

...and Eclipse ran "C:\ProgramData\Oracle\Java\javapath\javaw" - which gave the error. I suspect that this is something that came along with an installation of 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.

If it's doesn't work for you, you'll need to upgrade your JDK (to the Java versions - 8 in this case).

Instructions on how to edit PATH variable

weixin_41568126
乱世@小熊 I just wanted to mention that this happened to me after installing the IntelliJ IDEA IDE. Removing that line from the Path environment variable fixed Eclipse, and as far as I can tell, IDEA is still working as well.
接近 3 年之前 回复
csdnceshi79
python小菜 I know it's 3 years old, but I'm amazed that this still happens. Your solution fixed it for me.
大约 3 年之前 回复
csdnceshi57
perhaps? I, too, was facing this error on windows. Removed Java PATH entry in system variables made by Oracle's virtual box. Eclipse started normally then.
大约 3 年之前 回复
csdnceshi51
旧行李 Why would you delete the entry when you can just point it to the correct directory instead?
大约 4 年之前 回复
csdnceshi67
bug^君 Came across this javapath thing as well. In addition to removing it, I had to add a PATH variable to my current JDK (1.7.0_09) as well. Seems like the installations of different versions of JDK/JRE set env variables differently.
大约 5 年之前 回复
csdnceshi65
larry*wei Upgrading to JDK 8 update 40 also seemed to fix it.
5 年多之前 回复
csdnceshi55
~Onlooker so.. not only did oracle delete my java7 path var, but it uses "ProgramData" now? wtf?
接近 6 年之前 回复
csdnceshi54
hurriedly% I arrived at this same problem the same way mtyson answered separately here, but solved it with this answer by mortensi. Thanks!
接近 6 年之前 回复
weixin_41568208
北城已荒凉 Great Catch !!! Guys check your Env.PATH Variable and remove this C:\ProgramData\Oracle\Java\javapath;...It is added after JRE8 update I guess.
接近 6 年之前 回复
weixin_41568196
撒拉嘿哟木头 I had the same problem and tried different options but only solved it after removing entry "C:\ProgramData\Oracle\Java\javapath" from PATH variable. Good catch!
接近 6 年之前 回复
csdnceshi72
谁还没个明天 I just found this problem and noticed this same path prepended to my PATH env variable. I just installed VirtualBox yesterday, so I assume that is the culprit.
接近 6 年之前 回复

For me the solution was to go into (on 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!

csdnceshi60
℡Wang Yan you saved my lot lot of time...this trick worked for me too.
2 年多之前 回复
csdnceshi77
狐狸.fox I've done quite the same, I juste put 'C:\ProgramData\Oracle\Java\javapath;' at the end (last entry) of my 'Path' so eclipse find the "right" JVM before the "wrong" one.
接近 3 年之前 回复
weixin_41568183
零零乙 Perfect worked for me in windows 7 64 bit
4 年多之前 回复
weixin_41568127
?yb? Perfect worked like a charm :) worked for me in windows 8 64 bit
4 年多之前 回复
csdnceshi66
必承其重 | 欲带皇冠 This worked for me on Windows 10 64bit. Thanks!
接近 5 年之前 回复
csdnceshi73
喵-见缝插针 Thanks man! I have OS(win7 x64) and this solution prompted eclipse to start!
5 年多之前 回复
csdnceshi53
Lotus@ This worked for me (Win7 x64). I suspect this entry was added after installing a 32bit jre 8 for Firefox.
5 年多之前 回复
csdnceshi74
7*4 Worked on Windows seven too, it seems that the installation of Java 8 is messing up with environment variables.
5 年多之前 回复
csdnceshi51
旧行李 This worked for me after trying several thing. Pretty weird!
5 年多之前 回复

Your version of Eclipse is 64-bit, based on the paths and filenames. However, the version of Java that it's picking up is 32-bit, as indicated by where it is coming from, on this line:

-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 is the folder where 64-bit Windows places 64-bit programs.

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).

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. 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.

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!).

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.


Left for historical reference:

To check your version of Java, run

  java -version 

in a console (command prompt). On Windows 7 with 64-bit Java 6 I get:

  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.

On a 32-bit version you'll get something like:

  Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) 
weixin_41568126
乱世@小熊 I've not been able to find where the exact meaning is documented, unfortunately.
3 年多之前 回复
weixin_41568183
零零乙 What does "13" stand for?
3 年多之前 回复
weixin_41568184
叼花硬汉 I think is the first of the multiple problems that anyone just beginning with eclipse has to deal with...
接近 4 年之前 回复
csdnceshi73
喵-见缝插针 Your answer helped a lot! I think that you should specify in your answer how to find the second javaw.exe Personally I didn't straightly understand that I should look inside the other program files binary and copy that address. (and not from Program files x86) Finally I understood from what you said "Program Files (x86) is the folder where 64-bit Windows places 32-bit programs." that there is probably jaraws.exe in a different Program Files. Again this helped me a lot!
4 年多之前 回复
csdnceshi67
bug^君 When I had the same problem, I resolved it by editing eclipse.ini and changing Dosgi.requiredJavaVersion=1.7 to Dosgi.requiredJavaVersion=1.8
4 年多之前 回复
weixin_41568126
乱世@小熊 Java code produced by Eclipse will (in general) run on any platform that supports Java: 32bit or 64bit Windows, Linux or whatever. This question is about getting compatible versions of Eclipse and Java so that Eclipse works.
大约 5 年之前 回复
csdnceshi55
~Onlooker So I can't use Eclipse to develop 32bit java programs or what? I mean, in netbeans I targeted both 32bit and 64bit with no problems.
大约 5 年之前 回复
csdnceshi61
derek5. the bit required depends on the eclipse bit downloaded.
大约 5 年之前 回复
csdnceshi61
derek5. Im having the same problem. I checked my control panel and saw only 64-bit java versions installed, but command prompt says im running the 32-bit version, and if I go to Control Panel > Programs a tile appears that says Java 32-bit, yet I have no 32-bit java on my computer. what should I do?
大约 5 年之前 回复
csdnceshi77
狐狸.fox The answer shows how to find out the installed Java version. What is missing is what Java version is required!
大约 5 年之前 回复
csdnceshi76
斗士狗 so how do we get Eclipse to use the proper Java executable / version?
大约 5 年之前 回复
csdnceshi56
lrony* Using eclipse.exe -vm "C:\Program Files\Java\jdk1.8.0_25\bin" in Windows 7 64 bit works like a charm
5 年多之前 回复
csdnceshi64
游.程 hi, mine is Program Files <x86>\Java\jdk1.8.0_45\bin but I don't know what to do from here... i tried many things but none worked...
5 年多之前 回复
weixin_41568126
乱世@小熊 Either java.exe or javaw.exe should work - we are just trying to find out what version of Java is in that folder. Use the -version flag, don't replace it with anything - this tells Java to report its version rather than actually running anything.
5 年多之前 回复
csdnceshi79
python小菜 So should the path be to javaw.exe? Should -version be replaced with your desired version? Like -x86?
5 年多之前 回复
csdnceshi54
hurriedly% can someone tell me what to type. Nm, eclipse.exe -vm "\Program Files\Java\jdk1.8.0_05\jre\bin\javaw.exe"
5 年多之前 回复
weixin_41568126
乱世@小熊 See this question (stackoverflow.com/questions/25609405/…) and check you are typing the command correctly. Otherwise, I suggest you start a new question with your specific problem.
接近 6 年之前 回复
weixin_41568174
from.. Hello, I am having the same problem, so I used this command as you mentioned, but it open a dialog box with the error : Could not create a Java Virtual Machine, a fatal exception has occurred. Could you please help with this?
接近 6 年之前 回复
weixin_41568126
乱世@小熊 Yes, from the command prompt (using the file path shown in your error message, not necessarily the example I gave!)
6 年多之前 回复
csdnceshi53
Lotus@ how do i do this, i am having same problem and cant understand what you mean by calling it explicitly, do u mean like from the command prompt
6 年多之前 回复
weixin_41568110
七度&光 Well 3rd comment helped me. I didn't understand what the hell is "Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)". Now i know i have to download java-64bit
6 年多之前 回复
weixin_41568127
?yb? Have ticked. Didn't even know how to resolve a thread before you mentioned the tick - such a noob! Thanks for bearing with me.
8 年多之前 回复

If you have recently installed Java 8 and uninstalled Java 7, install JDK 8 and retry.

csdnceshi66
必承其重 | 欲带皇冠 Just to be clear, exit code=13 is always caused by bit-ness mistmatch between Eclipse and the JVM. People can arrive at that point a variety of ways, but in the end it isn't caused by a specific version of Java (6 vs. 7 vs. 8) or whether you use JRE vs. JDK - it's always rooted in a bit-ness mismatch. See the accepted answer above.
4 年多之前 回复
csdnceshi52
妄徒之命 I refuse to install a SDK when I actually only need a runtime.
4 年多之前 回复
weixin_41568126
乱世@小熊 Mansour - With Java 8, Oracle bundled the uninstall of prior versions with the install. If you selected that option on install, uninstalling may leave you with nothing.
5 年多之前 回复
csdnceshi55
~Onlooker This worked for me after a Java 8 install, even though I never uninstalled any other versions of java.
5 年多之前 回复
weixin_41568184
叼花硬汉 This worked for me. I installed Java 8 (I had J7) but I forgot to install the JDK8. So I did it, and "voilà". Thanks!
5 年多之前 回复

I had the same issue, Java was started but returned 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.

Next I added a line to file eclipse.ini → C:\Program Files\Java\jdk1.7.0_02\bin\javaw.exe.

That worked for me.

csdnceshi71
Memor.の I have not been updated the eclipse.ini just added jdk bin folder in PATH and its working for me.
4 年多之前 回复
csdnceshi64
游.程 => How exactly you modified eclipse.ini file? I also do not have admin permission and need to solve this same problem. When I added "-vm c:\My_JDK_1.6_Dir\bin\javaw.exe", it still gave me same error - exit code 13 and I see that in the full error log, it shows me two lines "-vm c:\My_JDK_1.6_Dir\bin\javaw.exe" and "-vm c:\ProgramData\Oracle\Java\javapath\javaw.exe". I want to make sure that it starts my JRE/JDK 1.6 and not the one from PATH which is pointing to 1.8
4 年多之前 回复
weixin_41568126
乱世@小熊 Thanks had the same problem where my Path was set to C:\ProgramData\Oracle\Java\javapath and I had moved it to the end.
大约 5 年之前 回复
csdnceshi53
Lotus@ Thanks, this saved me a lot of time. On my side I had to install the 64bit jdk and the change the environment variable that the updates had changed.
5 年多之前 回复
weixin_41568208
北城已荒凉 same problem with path not going to the right place
5 年多之前 回复
csdnceshi57
perhaps? Thanks Katusepi... It worked like a charm in my case... But i wonder how do the environment variable change with out my(administrator) permission in windows.. !!!
接近 6 年之前 回复
csdnceshi77
狐狸.fox Thanks Mohit, I too had updated java of firefox and path variable got updated as C:\ProgramData\Oracle\Java\javapath; .Hence ,eclipse wasn't getting initialised. Thanks again.
接近 6 年之前 回复
weixin_41568196
撒拉嘿哟木头 I had updated java, so the java update changed the env. variable value, fixed env. var. value, so it started working.
接近 6 年之前 回复

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
  2. Download the latest SDK (of course for x64 if your computer is x64)
  3. Install it
  4. Now the party is finished, and it's time to work with Eclipse ;)
csdnceshi74
7*4 Worked for me! Thanks
2 年多之前 回复

Adding vm argument to .ini file worked for me

-vm
C:\Program Files\Java\jdk1.7.0_65\bin\javaw.exe
csdnceshi78
程序go My case was Tomcat server (within eclipse) did not get stopped properly from the earlier run. So, I had to kill eclipse from Windows Task Manager. Thereafter eclipse was not starting any more. When I added this solution, it started working again. Seems strange, but this was indeed the fix.
5 年多之前 回复
weixin_41568127
?yb? your solution worked for me
5 年多之前 回复

I uninstalled Java update 25, and the issue was solved.

csdnceshi76
斗士狗 I updated my java version because a browser plugin needed the update. It did not work anyways and I ended up not having Eclipse fully functional. That sucked!
接近 6 年之前 回复
weixin_41568184
叼花硬汉 That is because probably, you are using jdk 1.7, and browser plugin have installed java 8 update 25, for videos. If you upgrade your jdk to 1.8, in that case this error will go away. Either upgrade the jdk, or uninstall the plug-in. Strange solution.
接近 6 年之前 回复
weixin_41568110
七度&光 wondering how i update my version some browser plugin make me do so!!! #Java
大约 6 年之前 回复

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.

Try it. It worked for me...

csdnceshi54
hurriedly% I did all other solutions, but they didn't work for my windows 10. Anyway, your solution worked for me and saved my many hours.... SALUTE !!!. Thanks so much.
大约 5 年之前 回复
共29条数据 1 3 尾页
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐