20

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?

Sabz Mbatha
  • 201
  • 1
  • 2
  • 3
  • "I don't have eclipse installed": STS is eclipse based, so actually, you do. take a look at this: http://stackoverflow.com/questions/11461607/cant-start-eclipse-java-was-started-but-returned-exit-code-13 – Stultuske May 21 '15 at 11:25
  • Correct! Just did a search on my machine and found its there indeed and installed! :-) @Stultuske – Sabz Mbatha May 21 '15 at 12:47
  • 1
    Sabz Mbatha: STS ís Eclipse, just with some other color schemes and some plugins by default installed, to which they added some of their own functionalities/plugins, but the core is still eclipse. so, as soon as you have STS, you have eclipse. – Stultuske May 21 '15 at 12:50

17 Answers17

25

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

Manoj
  • 624
  • 11
  • 17
  • Note I had to change the format to C:\Progra~1\Java\jdk1.8.0_131\bin\javaw.exe for it to work. *Take note it's Progra~1 instead of Program Files. In other words, no spaces. I also put it in the same place in the file as Manoj except I kept -vm and the path on the same line. – Kt Mack Jun 21 '17 at 03:22
  • I was getting the same error "Java exit code=13", and I've added "-vm C:\InstalledSoftwares\Jdk_1.8\bin" And it's working fine, however, doing this open a cmd prompt every time I open the IDE, is there anything that can be done so as to avoid that. – Ganga B K Aug 07 '17 at 13:53
  • Note if you have the issue with STS4 the file name is SpringToolSuite4.ini instead of STI.ini – ponder275 May 02 '19 at 18:19
4

Check that you are using correct java version for your OS architecture, 32 or 64 bits

Fran Montero
  • 1,581
  • 10
  • 21
4

STS mostly ends up with error code 13 if you are using for the first time. Here is a fix to the problem. Please visit this link I found here https://youtu.be/cMClVM6rzuc.

here is the summary of the solution - The Error while launching STS is mostly because you have downloaded 32 bit STS bundle from spring.io website. you need to check your system architecture and download the appropriate version. You can watch the video for detailed information. I am 100% sure you will find your solution

4

If you dowloaded 64 bits version of STS Spring, check the version of java you have by taping in cmd :

java -d64 -version 

If you dont have the jre 64 bits, install it and it will work .

Al Foиce ѫ
  • 3,844
  • 10
  • 34
  • 45
tlejmi
  • 321
  • 4
  • 8
  • Thanks a ton this one help to identify the issue. Somehow when I did $java -version it showed 64 bit but with java -d64 -version it showed error. I still don't understand how is it possible. – Rishabh Agarwal Jan 17 '18 at 23:42
4

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.

Rajanikanta Pradhan
  • 435
  • 1
  • 5
  • 11
3

I removed C:\ProgramData\Oracle\Java\javapath from the PATH environment variable. It worked for me then. So basically it's a path variable issue.

Markus
  • 1,934
  • 4
  • 21
  • 37
sachin
  • 31
  • 1
3

please make sure you download the 64bit version from https://spring.io/tools/sts/all.

make sure you download the 64bit version from https://spring.io/tools/sts/all

Will Wu
  • 457
  • 3
  • 13
2

On the STS page, the Download STS button downloads the version for 32-bit Windows by default. Under the download button, click See all versions (https://spring.io/tools/sts/all). From there you can click the menu button and select the 64-bit Windows version.

  • Exactly, it was the problem for me. No problem after download the 64-bit version. – mki Nov 17 '18 at 08:02
1

Just install 32-bit JRE (if you have 64 bit already installed) and point -vm to this 32-bit JRE as mentioned above.

AK M
  • 87
  • 8
1

So basically when you go to Spring website, it doesnt understand your client OS and prompts you to download 32 bit version. I faced the same issue and explicitly had to download 64 bit version, by clicking on "see all versions". Also some suggested removing "C:\ProgramData\Oracle\Java\javapath" entry from Path, but while it is true if you have actually downloaded JDK 1.8, it is not going to help resolve the specific issue here.

Spear A1
  • 430
  • 5
  • 16
1

Open "SpringToolSuite4.ini" or sts.ini and make sure you have javaw.exe path in .ini file.

-vm

D:\Projects\Softwares\JDK\bin\javaw.exe

File should look similar as below.

-startup

plugins/org.eclipse.equinox.launcher_1.5.400.v20190515-0925.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1000.v20190125-2016

-product

org.springframework.boot.ide.branding.sts4

--launcher.defaultAction

openFile

-vm

D:\Projects\Softwares\JDK\bin\javaw.exe

-vmargs

-Dosgi.requiredJavaVersion=1.8

-Xms256m

-Xmx1024m

-XX:+UseG1GC

-XX:+UseStringDeduplication

--add-modules=ALL-SYSTEM
Mr00Anderson
  • 823
  • 8
  • 16
0

You likely installed the default version of STS from the spring.io website which is normally the 32 bit version.

Click to see all versions and download the windows 64 bit version from the next page.

Good luck.

Moe Fawal
  • 1
  • 1
  • 1
0

By Removing following java path from environment variables path is fixed the issue.

C:\Program Files (x86)\Common Files\Oracle\Java\javapath

Have another jdk in path.

Praveen
  • 86
  • 1
  • 4
0

Initial I uninstall another Java SE Development Kit , next I added the follow path in the *SpringToolSuite4.ini in my case: *(depends of your IDE that you´ve installed)

-vm
C:\Program Files\Java\jdk1.8.0_131\bin\java.exe**
Alejandro
  • 75
  • 1
  • 2
0

You just need to reinstall JDK(same or latest version) and STS(not always required).

Cjo
  • 867
  • 8
  • 19
0

First of all, please check your STS path. Remove if there is any special character such as # or etc in your path. After verify this, please go for any of the above solutions ;)

Nizwer
  • 101
  • 1
  • 3
0

The first step is like the is already related above: open the document parameters of configuration "STS" and send the commands below to "openFile":

-vm
C:\Program Files\Java\jdk-11.0.2\bin\javaw.exe

To check the version of JDK, on your prompt do the command:

java -version

You will find in "build".

If you still having the problem with JDK path not finded, the path to found your JDK on pc is:


my computer -> archives and programs -> java -> jdk -> bin -> javaw

when you reach at this, click and inspect the properties of and copy the route to put on command after -vm.

llaet
  • 11
  • 1