summaryrefslogtreecommitdiffstats
path: root/core/find-jdk-tools-jar.sh
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:42 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:28:42 -0800
commit88b607994a148f4af5bffee163e39ce8296750c6 (patch)
treefa249ff843e976cf034f2029437d3362a8396321 /core/find-jdk-tools-jar.sh
parent05806d7af62e07c6225b2e7103a1b115ecf6c9ad (diff)
downloadbuild-88b607994a148f4af5bffee163e39ce8296750c6.zip
build-88b607994a148f4af5bffee163e39ce8296750c6.tar.gz
build-88b607994a148f4af5bffee163e39ce8296750c6.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'core/find-jdk-tools-jar.sh')
-rwxr-xr-xcore/find-jdk-tools-jar.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/find-jdk-tools-jar.sh b/core/find-jdk-tools-jar.sh
new file mode 100755
index 0000000..091eae4
--- /dev/null
+++ b/core/find-jdk-tools-jar.sh
@@ -0,0 +1,10 @@
+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)
+ 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