blob: ac0b3b6b59d1ad96ecda0fd8bd3df6f0125b5f51 [file] [log] [blame]
Jean-Baptiste Queruf9b556c2011-11-11 14:31:18 -08001#!/bin/sh
Angus Lees4cf76062009-01-30 10:17:23 +00002if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -07003 echo $ANDROID_JAVA_HOME/lib/tools.jar
4else
Bernhard Rosenkraenzer311384f2014-10-01 03:30:11 +02005 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
Rod Whitby3caa7cf2008-10-22 11:49:14 +103012 if [ -z "$JAVAC" ] ; then
Ying Wang1613f4f2010-09-22 14:11:49 -070013 exit 1
Rod Whitby3caa7cf2008-10-22 11:49:14 +103014 fi
Ying Wangd28feb02014-07-15 01:22:50 +000015 while [ -L "$JAVAC" ] ; do
16 LSLINE=$(ls -l "$JAVAC")
17 JAVAC=$(echo -n "$LSLINE" | sed -e "s/.* -> //")
18 done
Colin Cross112753c2015-10-23 14:33:51 -070019 echo $JAVAC | sed -e 's:\(.*\)/javac$:\1/../lib/tools.jar:'
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070020fi