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

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

improvements to jbigi scripts

support for Solaris (tested with Solaris 11 x86)

mbuild-all.sh:

  • output correctly formatted file names (tested in Solaris x86, FreeBSD (x86 and x64) and Linux (x86 & x64))
  • switch from echo -e to the more portable printf
  • more error checking, comments

debian/patches: refreshed based on changes to core/c/*
libjcpuid-x86_64-solaris.so: built in solaris 11 x86 with

java 1.7.0_07 and gcc 4.5.2, stripped

  • Property mode set to 100644
File size: 1.5 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    UNIXTYPE="linux"
39    if [ -d /usr/lib/jvm/java-gcj ]; then
40        JAVA_HOME="/usr/lib/jvm/java-gcj"
41    fi
42fi
43
44export JAVA_HOME UNIXTYPE
Note: See TracBrowser for help on using the repository browser.