Make cannot find tools.jar

南笙酒味 提交于 2019-12-22 04:07:15

问题


Running Ubuntu 12.04

I have added to PATH: /home/jeffrey/jdk1.6.0_43/lib

I am attempting to build from source using Make:

make -j16

But encounter the error:

build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com.  Stop.

Can anyone explain to me why Make cannot find tools.jar?

EDIT

JAVA_HOME=/home/jeffrey/jdk1.6.0_43/bin/java

Determined by entering env command into the shell. Furthermore, this is set for all users in the etc/profile

Additionally:

jeffrey@jeffrey-Satellite-M645:~/WORKING_DIRECTORY$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
jeffrey@jeffrey-Satellite-M645:~/WORKING_DIRECTORY$ 

回答1:


Setting the ANDROID_JAVA_HOME environment variable to JDK path, fixes this error.

I found the answer with this SO post.




回答2:


Make sure that JAVA_HOME env variable is set to jdk-install-dir




回答3:


Usually, this is caused by javac is not configured as a alternative for system. So there is no link of /usr/bin/javac for your javac.

Please setup the alternative for javac using the following command:

$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_32/bin/javac" 1

note: the installed directory of javac for me is "/usr/lib/jvm/jdk1.6.0_32/", you can change it by your configuration.



来源:https://stackoverflow.com/questions/18277504/make-cannot-find-tools-jar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!