Unable to locate tools.jar

2019-01-01 15:22发布

I am building a project in Java.

I have this error:

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar

I have installed a JDK and the folder: C:\Program Files\Java\jre6\lib is in my system but the file tools.jar is not there.

27条回答
无色无味的生活
2楼-- · 2019-01-01 16:13

If you're in a RHEL environment the package name containing tools.jar would end with "openjdk-devel".

查看更多
无色无味的生活
3楼-- · 2019-01-01 16:14

Make sure that your classpath is set correctly and pointing to the correct version of the JDK that you have installed. Also, are you using Open JDK? I have had this issue before after I tried to move from open JDK to Suns JDK. This is an example of how that issue could be fixed.

查看更多
临风纵饮
4楼-- · 2019-01-01 16:14

For me what's working: I downloaded an old version of Java 1.7

I actually set my JAVA_HOME from C:/program files X86/Java BUT after I installed the 1.7 version I had another Java in program files/Java. And at this moment I found the tools.jar here. Then I changed for this new path and it's working

查看更多
登录 后发表回答