Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to locate tools.jar for Java SE 14

Tags:

java

tools.jar

tools.jar is not present in latest Java version 14. Can anyone help me to understand whether it is replaced or where it is?

My system is having:

C:\Users\Admin>wmic os get osarchitecture
OSArchitecture
64-bit

I have installed latest Java version by downloading jdk-14.0.2_windows-x64_bin.exe from Oracle's website.

After Installation, I looked in installation folder C:\Program Files\Java\jdk-14.0.2\lib and it is not having tools.jar.

Do we need to install any other packages for JRE that would help with tools.jar?

If tools.jar is not present, what is the replacement?

like image 403
Madala Avatar asked Dec 30 '22 21:12

Madala


1 Answers

Do we need to install any other packages for JRE that would help with tools.jar?

No. There is no simple workaround.

If tools.jar is not present, what is the replacement?

There isn't a direct replacement. Instead you must change the application so that it doesn't depend on the existence of the file.

Java 9+ uses the Java Platform Module System rather than tools.jar, rt.jar and so one. See the other Answer on this page, by Giorgi Tsiklauri.

  • If the dependency is in your own code, change the code so that it access the Java compilers, etc via the Tools API. If your code is checking for the existence of tools.jar, remove the check and (if necessary) check a different way.

  • If the dependency is in third-party code (probably a tool) you need to upgrade it to a version that is compatible with the version of Java that you are trying to use.

like image 135
Stephen C Avatar answered Jan 14 '23 14:01

Stephen C