File: find-jdk-tools-jar.sh

package info (click to toggle)
android-platform-build 21-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,204 kB
  • ctags: 3,464
  • sloc: python: 3,797; cpp: 2,788; cs: 1,971; sh: 1,302; makefile: 1,114; ansic: 917; java: 734
file content (14 lines) | stat: -rwxr-xr-x 420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
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)
    if [ -z "$JAVAC" ] ; then
        exit 1
    fi
    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