Java was started but returned exit code=13 | Can not start Eclipse - Solution

Java was started but returned exit code=13 | Can not start Eclipse

Hello folks, In this tutorial we will discuss about the error while starting eclipse and it's solutions.

These are the common errors that we see frequently in our development process. Please see the following errors while starting up the eclipse after double click eclipse.exe file in eclipse location.


Java was started but returned exit code=13 | Can not start Eclipse - Solution

  1. Eclipse gives “Java was started but returned exit code 13”
  2. Cannot run Eclipse; JVM terminated. Exit code=13
  3. Java was started but returned exit code=13 | Can not start Eclipse

We might be experiencing these errors after updating the java version or running OS or JAVA irrelevant eclipse versions.


How to check java version installed:

To check the java version that you are currently using, Open command prompt (cmd) using "windows + r" then then type "cmd" then command prompt appears in a new window as following.

java -version

output:


D:\blogger>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) Client VM (build 25.131-b11, mixed mode)


java -version


To know which Java bit is installed on Windows 64 bit OS:


Program Files (x86): This is the folder where 64-bit Windows places 32-bit programs.
Program Files: This is the folder where 64-bit Windows places 64-bit programs.

So, If your java is in  folder "Program Files (x86)" then java is 32 bit or If your java is in "Program Files" then it is java is 64 bit.


Finding the eclipse version of bitness (32 bit or 64 bit):


Check the eclipse version in the location D:/eclipse/plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807.
If you see the file name like this having "win32.x86_64" then downloaded eclipse is 64 bit or file name has "win32.x86_1.1" then eclipse is 32 bit.

or

Open the file eclipse.ini at eclipse root location.
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.500.v20170531-1133 --> 32 bit.
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807 --> 64 bit


Error 1:

!SESSION 2017-08-06 18:47:46.019 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_IN
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.osgi 4 0 2017-08-06 18:47:53.020
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:260)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:240)
    at org.eclipse.swt.internal.C.<clinit>(C.java:21)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:653)
    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
    at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:154)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:96)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


Error 2:

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


How to fix the errors:

The following solutions work for both errors.

To know about Java History.

Solution 1:

Working combinations of OS, JDK and eclipse bitness (32 bit or 64 bit). In your case, if you were using 64-bit JDK with 32-bit eclipse in a 64-bit OS, after downgrading JDK to 32-bit then eclipse will start working.

It's good to 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 , 64bit Eclipse (64-bit only)

This solution should work but it is tricky. You should know the versions as described above.


Solution 2:

If OS is 32 bit then java and eclipse version also should be 32 bit.  Please make sure, you are having all 32 bit version.

If OS is 64 bit then there might be a chance of having two java versions 32 bit and 64 bit.

Check your eclipse version then open file "eclipse.ini" in eclipse root folder and add the following to it.

For 32 bit eclipse --> add "-vm C:\Program Files (x86)\Java\jre1.8.0_131\bin\javaw.exe"
For 64 bit eclipse --> add "-vm C:\Program Files\Java\jre1.8.0_131\bin\javaw.exe"




-vm -javaw.exe Java was started but returned exit code=13


Note: Check the location on your machine where the java installed.


Solution 3:

By default, eclipse refers to the java version which is present in "PATH" variable. If you have non compatible java path is added to "PATH" then above two solutions may not work.
Please add the correct java version location or remove from "PATH".

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

Download the latest eclipse version from the official link here. (Luna, Mars, Neon, Oxygen)


New eclipse package includes

  1. Data Tools Platform
  2. Git integration for Eclipse
  3. Eclipse Java Development Tools
  4. Eclipse Java EE Developer Tools
  5. JavaScript Development Tools
  6. Maven Integration for Eclipse
  7. Mylyn Task List
  8. Eclipse Plug-in Development Environment
  9. Remote System Explorer
  10. Code Recommenders Tools for Java Developers
  11. Eclipse XML Editors and Tools

0 Comments