Missing tools.jar when launching STS application
Asked Answered
V

13

33

I have the latest STS4. I am using installed java-1.8 JDK not embedded as the execution environment. My project just runs fine without any issue.

However when I launch the STS application itself I have a pop up saying "Missing tools.jar"

ScreenShot of the error

I have already tried:

  1. pointing JAVA_HOME to different JDK
  2. added -vm args in the .ini file.

Yet I cannot get rid of this pop up.

Vassell answered 5/10, 2018 at 9:23 Comment(4)
There is not much we can do remotely, with this little information. Check whether it is the right .ini file, check that there is only one -vm option (preferably as the first entry), that the path is correct and the option has the right form (-vm in one line, the path in the next line).Pry
Possible duplicate of Missing tools.jar in local repository breaks m2eclipseBearded
I am also getting the same issue, but I do not have any Eclipse installation present in my PC. I run only STS and I could not find any eclipse.ini within the STS installation folders.Gypsie
I'm experiencing a similar issue described in #60081514Jaguarundi
V
29

The fix is in the -vm parameter. the order and the absolute path of the javaw.exe seems to be the issue.

the readme file mentions _ "To run Eclipse with an alternate Java runtime environment, the path to the Java virtual machine's binary must be identified. With an Eclipse installation from the distribution, altering the $PATH variable to include the path to the alternate Java runtime environment is often not enough as the Eclipse that Linux distributions package often performs a scan internally to pick up GCJ by itself whilst ignoring what's on the $PATH."

So I have edited now the SpringToolSuite4.ini and made this entry

  -vm
 C:\UserTemp\Softwares\java\jdk\oracle-jdk-1.8-64bit\bin\javaw.exe

Restarted my STS and it works perfect.

The reference to set the JVM Specifying the JVM was very useful in understanding this.

Vassell answered 5/10, 2018 at 10:22 Comment(0)
W
30

I solved this same problem by modifying the file "eclipse.ini". First I tried to solve it by modifying the file SpringToolSuite4.ini, but nothing happened, because I previusly had installed the eclipse ide, and the change in SpringToolSuite4.ini didn't work. then I modified the file eclipse.ini; and it worked.

The changes that I did in eclipse.ini are detailed below:

To check with what Java version (JRE or JDK) Eclipse is running, do the following:

  • Open the menu item Help > About Eclipse. (On the Mac, it’s in the Eclipse-menu, not the Help-menu)
  • Click on Installation Details.
  • Switch to the tab Configuration
  • Search for a line that starts with -vm. The line following it shows which Java binary is used.

Depending on the name and location of the used Java binary one can figure out if a JRE or a JDK is used:

  • If the path contains “jre” (e.g. as in C:\Program Files\Java\jre6\bin\client\jvm.dll) it is a JRE
  • If the path contains “jdk” (e.g. as in C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe) it is a JDK.

If no JDK is used for Eclipse, change it:

  • Quit Eclipse if it is running
  • Go to the Eclipse installation directory and open the file eclipse.ini in a text editor.
  • Search for the line -vmargs
  • Before the line -vmargs, add two lines:

    On the first line, write -vm

    On the second line, write the path to your JDK installation (usually something like: C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe on Windows)*

source: https://matsim.org/docs/devguide/eclipse/jdk

Worldly answered 21/12, 2018 at 2:11 Comment(4)
but just one question, when I am using sts4, where is eclipse.ini?Spates
If you only have installed sts4, then you have to modify the SpringToolSuite4.ini file, but if also have installed eclipse ide in your system then probably you have to change de eclipse.ini file for making the changes happened.Worldly
this works! thanks! i installed sts4 from eclipse market, so other's answers said about changing springtoolsuite4.init is not work for me, because i have no springtoolsuite4.init.Byrn
It worked for me. It said Eclipse was using JRE and I added your two lines in eclipse.ini. It's worth to note that it should be two lines.Malefactor
V
29

The fix is in the -vm parameter. the order and the absolute path of the javaw.exe seems to be the issue.

the readme file mentions _ "To run Eclipse with an alternate Java runtime environment, the path to the Java virtual machine's binary must be identified. With an Eclipse installation from the distribution, altering the $PATH variable to include the path to the alternate Java runtime environment is often not enough as the Eclipse that Linux distributions package often performs a scan internally to pick up GCJ by itself whilst ignoring what's on the $PATH."

So I have edited now the SpringToolSuite4.ini and made this entry

  -vm
 C:\UserTemp\Softwares\java\jdk\oracle-jdk-1.8-64bit\bin\javaw.exe

Restarted my STS and it works perfect.

The reference to set the JVM Specifying the JVM was very useful in understanding this.

Vassell answered 5/10, 2018 at 10:22 Comment(0)
M
16

Don't spend too much time looking for tools.jar. If you get an error like that, don't be upset.

If you already have java JDK1.8, go to its lib folder, tools.jar should be available there. Copy and paste the same in JRE1.8 lib folder.

Materials answered 4/6, 2019 at 9:18 Comment(1)
Nice Fix. Thanks @AnkitaCalliope
A
5

I have STS4 so I have modified SpringToolSuite4.ini

I changed from:

[...]
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]

to exactly this

[...]
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.8.0_152\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]

And the message dissapeared

Abcoulomb answered 1/2, 2019 at 8:4 Comment(2)
I just updated my STS to 4.4.1 and started seeing this message. Your answer helped me and now I do not see the message. Thank you.Pith
For me, the change in that position -vm pointer position didn't work, rather it needs to be in the beginning of the file, it seems, as per Martin's suggestion: #60081514Jaguarundi
P
1

SOLUTION :

Check your Path JAVA_HOME - system property "Environment Variables"

for example: JAVA_HOME:

C:\Program Files\Java\jdk-12.0.1\lib

usually you only need add \lib at JAVA_HOME

enter image description here

Pus answered 25/6, 2019 at 7:19 Comment(0)
D
1

Just remove this line from variable "Path"

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

System Properties > Advanced > Environment Variables > Path > Edit > Reboot

Worked for me

Dissent answered 27/8, 2020 at 0:13 Comment(0)
P
0

In my case I had installed jre, and not jdk!

Observe that you have jdk installed!

Pegram answered 8/2, 2019 at 13:4 Comment(0)
T
0

I had the same issue when i upgraded to Java 11.

I simply edited SpringToolSuite4.ini and added

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

Thurmanthurmann answered 31/10, 2019 at 13:50 Comment(0)
B
0

For me, I had to do two things to make it work:

  1. Remove vmargs:
    • vmargs
    • Dosgi.requiredJavaVersion=1.8
  2. Setting the JDK:
    • vm
      C:\Program Files\Java\jdk1.8.0_131\bin
Benny answered 6/6, 2020 at 6:17 Comment(0)
B
0

By downloading the tool file and paste it in the jre\lib path. but make sure you should rename the pasted file as "tools.jar".

step 1 download the tool file. download link http://www.java2s.com/Code/Jar/t/Downloadtools160jar.htm

step 2 extract the zip file.

step 3 you should rename the included .jar file as "tools".

step 4 then copy the renamed tools.jar file and paste in the C:\Program Files\Java\jre8\lib\ path.

then restart the STS ide.

Baroque answered 15/6, 2020 at 11:19 Comment(0)
C
0
  • I have fixed this from Window->preferences->Java->Installed JREs . Then add the jdk bin path, uncheck other related jre paths

enter image description here

Cottony answered 24/6, 2020 at 10:46 Comment(0)
A
0

Copy JDK directory to your STS installation or extraction library and and rename JDK to jre. the directory structure of STS should look like this

.eclipseproduct
artifacts.xml
configuration
dropins
eclipsec.exe
features
jre
license.txt
META-INF
open-source-licenses.txt
p2
plugins
readme
SpringToolSuite4.exe
SpringToolSuite4.ini
Avila answered 6/8, 2020 at 11:53 Comment(0)
C
0

Once STS open, initially its looking for tools.jar in jre\lib folder its not available in jre\lib folder.

so we need copy the tools.jar from jdk\lib folder and paste in jre\lib folder.

restart the STS, issue will resolve.

Calliope answered 10/6, 2021 at 1:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.