Eclipse: Java was started but returned error code=13

JavaEclipse

Java Problem Overview


I just updated Java to 1.8 u25, and now I get this message every time I try to open 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?

This is my eclipse.ini file

-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

Java Solutions


Solution 1 - Java

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:

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

Note: The -vm parameter should be just before -vmargs and the path should be on a separate line. It should be the full path to the javaw.exe file. Do not enclose the path in double quotes (").

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

Solution 2 - Java

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

C:\ProgramData\Oracle\Java\javapath

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

To fix the problem:

  1. Right-click on Computer and choose Properties.

  2. Click Advanced system settings

  3. Click Environment Variables...

  4. Find the Path variable in the System variables section.

  5. Choose it and click Edit...

  6. Find and delete the above mentioned path.

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 Path variable, but the new path was added to the beginning of the Path variable and therefore resolution would use that path first.

Solution 3 - Java

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

Solution 4 - Java

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

Solution 5 - Java

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

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

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

IMO this Architecture miss match problem

Plese match your architecture type of JDK and eclipse.

Solution 6 - Java

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

Solution 7 - Java

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 wiki on how to configure the eclipse.ini file 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.

Once you are able to launch Eclipse, make sure you verify the installed JRE location under Java --> Installed JREs in the Preferences window.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionchif-iiView Question on Stackoverflow
Solution 1 - JavaSergey MorozovView Answer on Stackoverflow
Solution 2 - JavaSvend HansenView Answer on Stackoverflow
Solution 3 - JavaVito SebastianiView Answer on Stackoverflow
Solution 4 - JavaalvaroView Answer on Stackoverflow
Solution 5 - JavaGaurav vijayvargiyaView Answer on Stackoverflow
Solution 6 - JavaAdheep Mohamed Abdul KaderView Answer on Stackoverflow
Solution 7 - JavahfontanezView Answer on Stackoverflow