summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYing Wang <wangying@android.com>2014-07-15 01:23:49 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-15 00:42:07 +0000
commit15d00664884b9b8ce4766ab3a7fd15b83cbeaad9 (patch)
treefb07d4896eb9f33dd51e8465968756110d9da2b5
parentc7f1389d2683be9068d22666b484e48abcff12f1 (diff)
parentd28feb006605a791c01afe82544a756f90c5f9e9 (diff)
downloadbuild-15d00664884b9b8ce4766ab3a7fd15b83cbeaad9.zip
build-15d00664884b9b8ce4766ab3a7fd15b83cbeaad9.tar.gz
build-15d00664884b9b8ce4766ab3a7fd15b83cbeaad9.tar.bz2
Merge "Revert "Fix Java detection on some Linux distributions""
-rwxr-xr-xcore/find-jdk-tools-jar.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/find-jdk-tools-jar.sh b/core/find-jdk-tools-jar.sh
index d1b3ce9..f150a9a 100755
--- a/core/find-jdk-tools-jar.sh
+++ b/core/find-jdk-tools-jar.sh
@@ -2,9 +2,13 @@
if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then
echo $ANDROID_JAVA_HOME/lib/tools.jar
else
- JAVAC=$(readlink -f $(which javac))
+ 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