summaryrefslogtreecommitdiffstats
path: root/core/find-jdk-tools-jar.sh
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commitb6c1cf6de79035f58b512f4400db458c8401379a (patch)
tree68979db37c85b499bc384e4ac337ed1424baab51 /core/find-jdk-tools-jar.sh
downloadbuild-b6c1cf6de79035f58b512f4400db458c8401379a.zip
build-b6c1cf6de79035f58b512f4400db458c8401379a.tar.gz
build-b6c1cf6de79035f58b512f4400db458c8401379a.tar.bz2
Initial Contribution
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