Missing tools.jar when launching STS application

久未见 提交于 2019-12-02 21:44:28

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.

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

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

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.

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

Observe that you have jdk installed!

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!