source: core/c/find-java-home @ d0a3c72

Last change on this file since d0a3c72 was d0a3c72, checked in by kytv <kytv@…>, 9 years ago

Improved support for GNU/kFreeBSD

  • add kFreeBSD to NBI and CPUID
  • add kFreeBSD to jcpuid/jbigi build scripts
  • refresh debian patches to compensate for kFreeBSD changes
  • i2prouter: Detect kFreeBSD and normalize its name
  • clean up osid (switching to "elif") and adding support for detecting kFreeBSD
  • update postinstall.sh; I2P cannot be installed using gij so postinstall.sh will not be run. If/when openjdk finally comes to kFreeBSD, we'll be ready for it.
  • Property mode set to 100644
File size: 1.1 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 = "openbsd" ]; then
9    if [ -d /usr/local/jdk-1.7.0 ]; then
10        JAVA_HOME="/usr/local/jdk-1.7.0"
11    fi
12elif [ $UNIXTYPE = "netbsd" ]; then
13    if [ -d /usr/pkg/java/openjdk7 ]; then
14        JAVA_HOME="/usr/pkg/java/openjdk7"
15    fi
16elif [ $UNIXTYPE = "linux" ] && [ -e /etc/debian_version ]; then
17    if [ -d /usr/lib/jvm/default-java ]; then
18       JAVA_HOME="/usr/lib/jvm/default-java"
19    fi
20elif [ $UNIXTYPE = "linux" ] && [ -e /etc/arch-release ]; then
21    if [ -d /usr/lib/jvm/java-7-openjdk ]; then
22        JAVA_HOME="/usr/lib/jvm/java-7-openjdk"
23    elif [ -d /usr/lib/jvm/java-6-openjdk ]; then
24        JAVA_HOME="/usr/lib/jvm/java-6-openjdk"
25    fi
26elif [ $UNIXTYPE = "darwin" ]; then
27    JAVA_HOME=$(/usr/libexec/java_home)
28elif [ $UNIXTYPE = "gnu/kfreebsd" ]; then
29    if [ -d /usr/lib/jvm/java-gcj ]; then
30        JAVA_HOME="/usr/lib/jvm/java-gcj"
31    fi
32fi
33
34export JAVA_HOME
Note: See TracBrowser for help on using the repository browser.