File: find-jdk-tools-jar.sh

package info (click to toggle)
android-platform-build 1%3A8.1.0%2Br23-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,620 kB
  • sloc: python: 12,074; cpp: 6,068; cs: 5,512; makefile: 2,356; sh: 1,829; java: 1,359; ansic: 987
file content (20 lines) | stat: -rwxr-xr-x 598 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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=$(realpath $(which javac) 2>/dev/null)
    if [ -z "$JAVAC" ]; then
        JAVAC=$(readlink -f $(which javac) 2>/dev/null)
    fi
    if [ -z "$JAVAC" ]; then
        JAVAC=$(which javac)
    fi
    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:\(.*\)/javac$:\1/../lib/tools.jar:'
fi