blob: 02248295f9050be4fd52542ab8015aae0e9e8a40 [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
The Android Open Source Projectb6c1cf62008-10-21 07:00:00 -070019 echo $JAVAC | sed -e "s:\(.*\)/bin/javac.*:\\1/lib/tools.jar:"
20fi