STS launch error - Java was started but returned e

2020-03-08 09:02发布

问题:

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?

回答1:

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



回答2:

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



回答3:

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 .



回答5:

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



回答6:

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.



回答7:

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.



回答8:

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.



回答9:

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



回答10:

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.



回答11:

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.



回答12:

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.



回答13:

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**


回答14:

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



回答15:

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 ;)



回答16:

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.