Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STS launch error - Java was started but returned exit code=13

Tags:

So I installed STS a while back now onto my Windows 7 64-bit machine, every time I try run STS I get the attached Java exit code=13 error below.

I don't have have Eclipse installed into my machine, I mention this because every time I have tried to Google this error code threads about the same issue happening on Eclipse come up.

I have also tried checking if Java is installed on my machine which it is.

Does anyone know how to resolve this?

like image 820
Sabz Mbatha Avatar asked May 21 '15 11:05

Sabz Mbatha


People also ask

How do I fix java was started by returned exit code 13?

If you have installed 64 bit version of java jdk and 32 bit version of eclipse ide or vice versa , then you will get this error. You will get rid of this error by just downloading the correct version of java jdk and eclipse ide.

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.


2 Answers

First you need to check that you are using 64 bit java. Next you need to point to that version of java in your STS.ini file.

You can do this by specifying the -vm option in the STS.ini file. The -vm option must be placed after the other Eclipse-specific options (such as -product, --launcher.*, etc), but before the -vmargs option.

-vm argument might look like:

-vm
C:\jdk1.7.0_21\bin\javaw.exe

or

-vm C:\jdk1.7.0_21\bin\javaw.exe 

or

-vm C:\jdk1.7.0_21\jre\bin\java.exe

If you encounter Java was started but returned exit code=1 point the `-vm option to jvm.dll

-vm
C:\Development\Java\64bit\jdk1.7.0_09\jre\bin\server\jvm.dll

Here is how I added it in my STS.ini file.

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vm
C:\Program Files\IBM\Java71\jre\bin\java.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-XX:MaxPermSize=256m
-Xverify:none
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx1200m

References:

  1. Eclipse Wiki page

  2. Stack overflow answer by DNA to similar question

like image 144
Manoj Avatar answered Sep 18 '22 05:09

Manoj


I faced this issue due to my java update. So below is the cause

  1. Or java 64 bit and eclipse 32 bit version
  2. You have java version 32 bit and eclipse 64 bit version
  3. External cause, if you have two version of java installed(32 bit and 64 bit), if one got updated means your path variable pointing to java will change.

Solution:- Check your java version is 32 bit or 64 bit with command below

 java -d64 -version

If It's 64 bit it will show

java version "1.8.0_181"

Java(TM) SE Runtime Environment (build 1.8.0_181-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

If It's not

It will show something like this

Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.

Based on the java version change your STS, to either 32 bit or 64 bit.

like image 31
Rajanikanta Pradhan Avatar answered Sep 21 '22 05:09

Rajanikanta Pradhan