Jean-Baptiste Queru | f9b556c | 2011-11-11 14:31:18 -0800 | [diff] [blame] | 1 | #!/bin/sh |
Angus Lees | 4cf7606 | 2009-01-30 10:17:23 +0000 | [diff] [blame] | 2 | if [ "x$ANDROID_JAVA_HOME" != x ] && [ -e "$ANDROID_JAVA_HOME/lib/tools.jar" ] ; then |
The Android Open Source Project | b6c1cf6 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 3 | echo $ANDROID_JAVA_HOME/lib/tools.jar |
| 4 | else |
Bernhard Rosenkraenzer | 311384f | 2014-10-01 03:30:11 +0200 | [diff] [blame] | 5 | 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 Whitby | 3caa7cf | 2008-10-22 11:49:14 +1030 | [diff] [blame] | 12 | if [ -z "$JAVAC" ] ; then |
Ying Wang | 1613f4f | 2010-09-22 14:11:49 -0700 | [diff] [blame] | 13 | exit 1 |
Rod Whitby | 3caa7cf | 2008-10-22 11:49:14 +1030 | [diff] [blame] | 14 | fi |
Ying Wang | d28feb0 | 2014-07-15 01:22:50 +0000 | [diff] [blame] | 15 | while [ -L "$JAVAC" ] ; do |
| 16 | LSLINE=$(ls -l "$JAVAC") |
| 17 | JAVAC=$(echo -n "$LSLINE" | sed -e "s/.* -> //") |
| 18 | done |
The Android Open Source Project | b6c1cf6 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 19 | echo $JAVAC | sed -e "s:\(.*\)/bin/javac.*:\\1/lib/tools.jar:" |
| 20 | fi |