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:01

go to your jdk path where you installed your java

For e.g In my PC JDK installed in the following path

"C:\Program Files\Java\jdk1.7.0_17\";

After go to the lib folder e.g "C:\Program Files\Java\jdk1.7.0_17\lib"

in the lib directory there is tool.jar file

Copy this file and past it in the lib forlder of jre7 directory for e.g

"C:\Program Files\Java\jre7\lib"

查看更多
流年柔荑漫光年
3楼-- · 2019-01-01 16:03

No, according to your directory structure, you have installed a JRE, not a JDK. There's a difference.

C:\Program Files\Java\jre6\lib
                      ^^^^

It should be something like:

C:\Program Files\Java\jdk1.6.0_24
查看更多
与风俱净
4楼-- · 2019-01-01 16:03

This is the solution for Windows: in Computer > Advanced system settings > Advanced > Environment variables..., add this in System variables:

enter image description here

查看更多
柔情千种
5楼-- · 2019-01-01 16:04

In eclipse window> preferences>Java> Installed JRE, I pointed the directory to the jre directory in the jdk 1.7 and i worked file for me e.g C:\Program Files\Java\jdk1.7.0_71\jre

查看更多
初与友歌
6楼-- · 2019-01-01 16:04
Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar

if you have installed jdk then

..Java/jdkx.x.x

folder must exist there so in stall it and give full path like

C:\Program Files\Java\jdk1.6.0\lib\tools.jar
查看更多
查无此人
7楼-- · 2019-01-01 16:05

Set your JAVA_HOME environmental variable to point to C:\Program Files\Java\jdk1.7.0_02.

查看更多
登录 后发表回答