source: core/c/find-java-home @ 5e90780

Last change on this file since 5e90780 was 5e90780, checked in by kytv <kytv@…>, 7 years ago

jbigi/jcpuid build scripts: Look for OpenJDK7 in kFreeBSD (it has landed in Debian testing)

  • Property mode set to 100644
File size: 1.9 KB
Line 
1UNIXTYPE=$(uname -s | tr "[A-Z]" "[a-z]")
2if [ $UNIXTYPE = "freebsd" ]; then
3    if [ -d /usr/local/openjdk6 ]; then
4        JAVA_HOME="/usr/local/openjdk6"
5    elif [ -d /usr/local/openjdk7 ]; then
6        JAVA_HOME="/usr/local/openjdk7"
7    fi
8elif [ $UNIXTYPE = "sunos" ]; then
9    UNIXTYPE="solaris"
10    if [ -d /usr/jdk/latest/ ]; then
11        JAVA_HOME="/usr/jdk/latest"
12    elif [ -d /usr/jdk/instances/jdk1.7.0/ ]; then
13        JAVA_HOME="/usr/jdk/instances/jdk1.7.0"
14    elif [ -d /usr/jdk/instances/jdk1.6.0 ]; then
15        JAVA_HOME="/usr/jdk/instances/jdk1.6.0"
16    fi
17elif [ $UNIXTYPE = "openbsd" ]; then
18    if [ -d /usr/local/jdk-1.7.0 ]; then
19        JAVA_HOME="/usr/local/jdk-1.7.0"
20    fi
21elif [ $UNIXTYPE = "netbsd" ]; then
22    if [ -d /usr/pkg/java/openjdk7 ]; then
23        JAVA_HOME="/usr/pkg/java/openjdk7"
24    fi
25elif [ $UNIXTYPE = "linux" ] && [ -e /etc/debian_version ]; then
26    if [ -d /usr/lib/jvm/default-java ]; then
27       JAVA_HOME="/usr/lib/jvm/default-java"
28    fi
29elif [ $UNIXTYPE = "linux" ] && [ -e /etc/arch-release ]; then
30    if [ -d /usr/lib/jvm/java-7-openjdk ]; then
31        JAVA_HOME="/usr/lib/jvm/java-7-openjdk"
32    elif [ -d /usr/lib/jvm/java-6-openjdk ]; then
33        JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
34    fi
35elif [ $UNIXTYPE = "darwin" ]; then
36    JAVA_HOME=$(/usr/libexec/java_home)
37elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
38    # Even though the kernel is FreeBSD's, the userland is GNU.
39    # kFreeBSD has $JAVA_HOME/include/linux instead of $JAVA_HOME/include/*bsd
40    UNIXTYPE="linux"
41    # OpenJDK 7 is supported as of Debian Jessie
42    if [ -d /usr/lib/jvm/java-7-openjdk-kfreebsd-amd64/ ]; then
43        JAVA_HOME="/usr/lib/jvm/java-7-openjdk-kfreebsd-amd64"
44    elif [ -d /usr/lib/jvm/java-7-openjdk-kfreebsd-i386/ ]; then
45        JAVA_HOME="/usr/lib/jvm/java-7-openjdk-kfreebsd-i386"
46    elif [ -d /usr/lib/jvm/java-gcj ]; then
47        JAVA_HOME="/usr/lib/jvm/java-gcj"
48    fi
49fi
50
51export JAVA_HOME UNIXTYPE
Note: See TracBrowser for help on using the repository browser.