Pages

Monday, March 23, 2020

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

Java was started but returned exit code=13 

1. Overview

In this tutorial, we''ll learn about the error while starting eclipse "Java was started but returned exit code=13" that can not start Eclipse and it's solutions.

Another similar error "java started but returned exit code 1" and same error can be seen with oxygen or neon "java started but returned exit code 13 eclipse neon" 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. 

Read more on "Troubleshooting" article.



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


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

1.1 Eclipse Error 

Java was started but returned exit code=13

We need to know about the following to solve these eclipse start up errors. All these are discussed in the further of this post.

1) Java version installed with os bit
2) Eclipse bit version
3) What is the problem coming while starting eclipse.

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



[Fixed] Java was started but returned exit code=13 - java version



3. OS and Eclipse Bit Verification


We must know on which bit os is running on windows whether it is 32 bit or 64 bit and the same for eclipse whether 32 bit or 64 bit eclipse.

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

First way to check, Just see that where your java is installed in your C drive. Following are folder names. Check which directory your java installed.

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.

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


Second way to 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.

3.3 eclipse.ini


Last way is 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



4. Possible errors

If there is any compatibility issues between java and eclipse then the following errors are supposed to be happen.

Java was started but returned exit code=13 - Can't start Eclipse is commonly faced by most of the developers.

4.1 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.(C.java:21)
    at org.eclipse.swt.widgets.Display.(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)

4.2 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


5. Fix to Java was started but returned exit code=13 


How to fix the errors:

The following solutions work for both errors.

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


5.2 Solution 2

If java is configured wrongly in Eclipse.ini file in the eclipse directory.

Eclipse.ini file must have a valid absolute java location. If you have installed many java version, select right version that compatible to the current eclipse.

-vm 
C:\Program Files (x86)\Java\jdk1.8.0_201\bin\javaw.exe



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"

From eclipse.ini file:

After adding -vm arguement.

--launcher.appendVmargs
-vm 
C:\Program Files (x86)\Java\jdk1.8.0_201\bin\javaw.exe
-Dosgi.requiredJavaVersion=1.8
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC



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

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

5.3 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

    Data Tools Platform
    Git integration for Eclipse
    Eclipse Java Development Tools
    Eclipse Java EE Developer Tools
    JavaScript Development Tools
    Maven Integration for Eclipse
    Mylyn Task List
    Eclipse Plug-in Development Environment
    Remote System Explorer
    Code Recommenders Tools for Java Developers
    Eclipse XML Editors and Tools

6. Conclusion


In this tutorial, We've seen what are the common issues that occur when we start eclipse. Most common issues are

1. java was started but returned exit code=13
2. Cannot load 64-bit SWT libraries on 32-bit JVM


Discussed what are the things needs to be checked on the initial steps and provided all possible solutions. This tutorial will provide the accurate solutions for eclipse issues.

If these are not helping, Please post your exact error what your getting in your case. We will provide you the fix.

References:

TheCrazyProgram Fix
JavaHungry Answers
StackOverFlow

1 comment:

Please do not add any spam links in the comments section.