Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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 
like image 809
Ben E. Avatar asked Jul 12 '12 22:07

Ben E.


People also ask

How do I fix exit code 13 in Eclipse?

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.

Why java is not working in Eclipse?

Verify if you have installed a different version of JDK/JRE from your Eclipse. If you have installed 64 bits JDK version and your Eclipse version is 32 bits, it won't work. They have to be equal. If appears: "Error: This Java instance does not support a 64-bit JVM.

Where can I find Eclipse INI file?

On Windows and on most Linux distributions the eclipse. ini file is located in the same directory as the eclipse executable. On macOS, control-click on the executable, select Show Package Contents and then go to either Contents/MacOS/eclipse. ini or Contents/Eclipse/eclipse.


2 Answers

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

like image 21
mortensi Avatar answered Sep 27 '22 03:09

mortensi


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)  

If you are on a 64-bit machine, then you can install the 64-bit JDK and uninstall the 32-bit one. For instance on Windows 10, just go to Settings and under Apps, you will find Java. Click on it and you will find all the different versions. Now you can select which one to uninstall.

like image 63
DNA Avatar answered Sep 26 '22 03:09

DNA