summaryrefslogtreecommitdiffstats
path: root/core/find-jdk-tools-jar.sh
diff options
context:
space:
mode:
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