platform_build/core/find-jdk-tools-jar.sh
Ying Wang ec5e729fcf Make build/core/find-jdk-tools-jar.sh fail more explicitly
http://b/issue?id=1505957
Before this change, if tools.jar can not be found, make reports error like:
make: *** No rule to make target `Please-install-JDK-5.0,-update-12-or-higher,-which-you-can-download-from-java.sun.com'...
With this change, the error message is much nicer:
build/core/config.mk:264: *** Error: could not find jdk tools.jar, please install JDK-5.0, update 12 or higher, which you can download from java.sun.com.  Stop.

Change-Id: Id33cfb6ee7676d66f00d0a41d07c1f27abc6a402
2010-07-20 16:30:40 -07:00

13 lines
397 B
Bash
Executable file

if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then
echo $ANDROID_JAVA_HOME/lib/tools.jar
else
JAVAC=$(which javac)
if [ -z "$JAVAC" ] ; then
exit 1
fi
while [ -L $JAVAC ] ; do
LSLINE=$(ls -l $JAVAC)
JAVAC=$(echo -n $LSLINE | sed -e "s/.* -> //")
done
echo $JAVAC | sed -e "s:\(.*\)/bin/javac.*:\\1/lib/tools.jar:"
fi