Unable to locate tools.jar. Expected to find it in

2019-04-03 09:09发布

When I try to run the following command I get an error:

$ ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10

Here is the error:

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

I have given jdk path in JAVA_HOME variable as C:\PROGRA~1\Java\jdk1.6.0_25 as my jdk location is C:\Program Files (x86)\Java\jdk1.6.0_25.

What is the issue? Please help me.Thanks in advance.

When I have tried to run the command ant -diagnostics , I got

java.home : C:\Program Files\Java\jre6

2条回答
一夜七次
2楼-- · 2019-04-03 09:12

You are probably building some project that has the old file called local.properties at the project root level. There is a sdk.dir property there and it is pointing wrongly. Open that file with editor and correct.

Also, your command line looks questionable. There you specify the sdk location using some Unix path and from the rest of you message looks you are on Windows. Be sure that property matches your sdk location. It may not be actually required at all.

查看更多
别忘想泡老子
3楼-- · 2019-04-03 09:37

You should try adding %JAVA_HOME%\bin at the beginning of your PATH environment variable (given syntax assumes Windows of course). As Peter Knego commented, tools.jar exists in the JDK, not the JRE, so you must make sure the JAVA_HOME points to your JDK directory.

查看更多
登录 后发表回答