1 #!/bin/sh 2 if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then 3 echo $ANDROID_JAVA_HOME/lib/tools.jar 4 else 5 JAVAC=$(realpath $(which javac) 2>/dev/null) 6 if [ -z "$JAVAC" ]; then 7 JAVAC=$(readlink -f $(which javac) 2>/dev/null) 8 fi 9 if [ -z "$JAVAC" ]; then 10 JAVAC=$(which javac) 11 fi 12 if [ -z "$JAVAC" ] ; then 13 exit 1 14 fi 15 while [ -L "$JAVAC" ] ; do 16 LSLINE=$(ls -l "$JAVAC") 17 JAVAC=$(echo -n "$LSLINE" | sed -e "s/.* -> //") 18 done 19 echo $JAVAC | sed -e 's:\(.*\)/javac$:\1/../lib/tools.jar:' 20 fi 21