11

I downloaded Spring Toolset 3.6 from here:

https://spring.io/tools/sts/all

Unzipped it, launched sts.exe and got this error:

---------------------------
STS
---------------------------
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run STS. No Java virtual machine
was found after searching the following locations:
D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\jre\bin\javaw.exe
javaw.exe in your current PATH
---------------------------
OK   
---------------------------

I have following version of (32 bit) java

C:\Users\Chad>java.exe -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) Client VM (build 24.71-b01, mixed mode, sharing)

I tried adding the following 2 lines to the top of the STS.ini:

-vm
C:\Windows\SysWOW64\javaw.exe

and got this error:

---------------------------
STS
---------------------------
Java was started but returned exit code=13
C:\Windows\SysWOW64\javaw.exe
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion=10001
-jar D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\STS.exe
-name STS
--launcher.library D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326\eclipse_1603.dll
-startup D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.overrideVmargs
-exitdata 1240_5c
-product org.springsource.sts.ide
-vm C:\Windows\SysWOW64\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-XX:MaxPermSize=256m
-Dorg.eclipse.swt.browser.IEVersion=10001
-jar D:\Setup\spring36\sts-bundle\sts-3.6.3.RELEASE\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar 
---------------------------
OK   
---------------------------

Tried adding an Env variable:

JAVA_HOME = C:\Windows\SysWOW64\

...same error

when I opened up the Java Control panel, I saw that the active version, 1.7 pointed to this path:

C:\Program Files (x86)\Java\jre7\bin\javaw.exe

I also tried adding the following to my PATH variable

C:\Program Files (x86)\Java\jre7\bin

...no change,

When I noticed the following line in one of the error messages above:

Dosgi.requiredJavaVersion=1.6

I tried switching the active version of java (the one checked inh the control panel) to the 1.65 version and I changed all of the above paths to point to reference it.

C:\Program Files (x86)\Java\jre6\bin\javaw.exe

I'm sure I didn't try all permutations, but I am obviously gasping at straws.

I also tried downloading the 32 bit JDK because I saw something about maybe needing that.

Is this some sort of a 32/64 bit mix up? The STS zip file was named indicating a 32 bit version, although at work on my laptop I somewhere found a version that had both 32 and 64 in the name of the zip. I only saw one version of the app in the zip file. How can one app be both 32 and 64 bit at the same time?

spring-tool-suite-3.6.3.RELEASE-e4.4.1-win32.zip

This is my first attempt to try anything using Java and I'm frustrated just starting...

Chad
  • 23,658
  • 51
  • 191
  • 321

9 Answers9

17

I had this problem with STS4. Solved it adding -vm parameter in SpringToolSuite4.ini:

-startup
plugins/org.eclipse.equinox.launcher_1.5.100.v20180827-1352.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.800.v20180827-1352
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.8.0_162\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-Xms40m
-Xmx1200m

IMPORTANT: this didn't work when I added the config parameter at the end of the file, it had to be in the middle between openFile and -vmargs lines.

For deeper details about STS/Eclipse INI configuration check Missing tools.jar when launching STS application and eclipse.ini

  • 1
    Fantastic! The position in SpringToolSuite4.ini file made all the difference. I likewise had to place it above the '-vmargs' parameter. My issue is resolved as well. As a Windows power user, I have my Java JDK installed outside the expected "Program Files" directory, and it clearly found the Java 1.8 JRE (not the Java 1.8 JDK or Java 11 JDK) where another system had installed it previously. – Michael M Jul 26 '19 at 19:19
  • @FranciscoAcevedo Thanks :). I was facing the same issue. Saved my day. – Anish B. Apr 19 '20 at 12:09
12

Your STS/Eclipse is x64 bit I think due to this line "-arch x86_64" in your STS startup error. You'd need to specify -vm argument in STS.ini. For example: -vm C:\Java\JDK\1.6\bin\javaw.exe

The folder you've specified C:\Windows\SysWOW64\javaw.exe... is it pointing to the right x64 VM? The JDK/JRE folder must have bin, lib and other sub-folders. The javaw.exe that you point to must be in the "bin" folder. I don't see the "bin" in your VM path. Keep the file structure of the JDK/JRE folder unchanged.

aboyko
  • 1,337
  • 1
  • 9
  • 11
  • I had the same issue on two different computers, both of which only had the 32 bit JRE installed. At work, I instaklled the x86_64 version but at home I installed the 32 bit version. The result was the same in both places. However, when you confirmed that I installed the 64 bit version (at work) I decided to try the 32 bit version here to, expecting the same result as on my home PC. This time it worked. No modification to the INI file was needed. Now, the mystery is why my home PC didn;t have the same outcome. Nevertheless, your answer led me to the solution for 1 machine. Thank you! – Chad Jan 16 '15 at 16:56
  • It can be somewhat hard to determine where you are getting the 'auto detected' JRE/JDK from, this can lead to 'mysterious' behavior. So it is always best to add -vm arguments to the ini file and make sure it points to the right JVM you want to run STS with. The 'right' JVM must be compatibile in terms of being same 32/64 bit and also it must be a JDK, not a JRE (the implicitly detected VM on windows boxes is often a JRE). – Kris Jan 16 '15 at 17:19
5

Linux

This solution works with:

Ubuntu 18.04.1 LTS

Spring Tool Suite 4 
Version: 4.1.1.RELEASE
Build Id: 201901241133
OS: Linux, v.4.15.0-45-generic, x86_64 / gtk 3.22.30
Java version: 11.0.2

In your Spring Tool Suite root folder add to the file SprintToolSuite4.ini following 2 lines after openFile:

-vm
/usr/lib/jvm/<your-java-folder>/<your-java-subfolder>/bin

Your SprintToolSuite4.ini file should look now something like this:

enter image description here


Other OSs

Add the right path to your JRE (the /bin folder) to your ini file.

rbelow
  • 726
  • 8
  • 7
1

You need to have C:\Program Files\Java\jdk-14.0.2\bin in your path.

also check that,

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

in SpringToolSuite4.ini.

Make sure above and then open SpringToolSuite4.exe.

Vikram Sapate
  • 1,087
  • 1
  • 11
  • 16
0

My problem was slightly different in that STS originally worked correctly for some time, and then failed to work on the next launch.

Following the suggestions in the error message (that 'No Java virtual machine was found after searching the following locations: ...\sts-bundle\sts-3.6.3.RELEASE\jre\bin\javaw.exe in your current PATH'), I was able to identify that the entire \jre was missing.

Reinstalling JRE 1.7 with default settings, and copying the files from C:\Program Files\Java to my STS installation resolved the issue.

Jamie Weston
  • 351
  • 4
  • 14
0

I have faced this issue multiple times. Please do following checks in order to rectify the above issue.

  1. Check your environment variables for Java. Some times even if the environment variables setup properly, it doesn't identify when you are trying to java -version in command prompt.
  2. if it is eclipse/ STS then open eclipse.ini or sts.ini configuration file and setup your run-time environment in the following way.

Below open file just add the following two lines and save it and restart your eclipse/STS.

-vm
C:\Program Files\Oracle\OpenJDK 11.0.1\bin
Sumanth Varada
  • 1,122
  • 1
  • 16
  • 17
0

I solve this issue with the following steps:

  1. create a jre folder in sts-4.6.1.RELEASE

  2. create bin folder in jre folder

  3. copy javaw.exe and paste to the bin folder

pheeleeppoo
  • 1,491
  • 6
  • 25
  • 29
0

Copy the sts release folder to program files. It worked for me instead of making changes in .ini config file. Do try.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 07 '21 at 15:39
-1

Go to your installed JRE folder (\Program Files\Java\jre [any version installed]\bin) then look for javaw.exe. Copy that application to your spring folder.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Leroy
  • 352
  • 2
  • 11