Can I use tools.jar in the Classpath of my Java project?

Asked

Viewed 127 times

1

I’d like to know if there’s a problem, since he’s part of the JDK, or even if it’s necessary.

2 answers

1


You need to add the tools.jar to classpath if you want to make use of the classes.

Such a file contains classes used for developing Java programs, such as Java compiler classes.

It is also distributed with JDK, so unlike the JRE classes that are automatically present for the program, you have no guarantee nor that this library will be present in the user environment. That’s why some tools require you to use a JDK.

Reference: https://docs.oracle.com/javase/7/docs/technotes/tools/findingclasses.html

0

Probably not necessary, he’s already part of JDK. Just check if where to run the application, which JAVA_HOME is set.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.