1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/java-dirtree/parse-config
3 # Copyright (C) 2004 - 2021 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 if [ -f $root/var/adm/packages/java-dirtree ]; then
13 # We have to set JAVA_HOME environment variable. For this we
14 # check every jdk we know and verify if it is installed.
16 JAVA_EVERYJDK="sun-jdk-142 ibm-jdk-142 blackdown-jdk"
18 # ooo doesn't build with java 1.5+
19 [ "$pkg" != "ooo" ] &&
20 JAVA_EVERYJDK="sun-jdk-160 sun-jdk-150 ibm-jdk-150 $JAVA_EVERYJDK"
22 # use kaffe only for marked packages
23 if hasflag KAFFE; then
24 JAVA_EVERYJDK="kaffe $JAVA_EVERYJDK"
27 # clean the enviroment
28 unset JAVA_HOME CLASSPATH
30 for jdk in $JAVA_EVERYJDK; do
31 if [ -f $root$( pkgprefix sysconfdir java-dirtree )/$jdk.in ]; then
34 # Make java home available to java packages.
35 JAVA_HOME=$root/$( pkgprefix $jdk )
36 CLASSPATH="$root$( pkgprefix libdir java-dirtree ):$CLASSPATH"
37 CLASSPATH="$root/$( pkgprefix $jdk )/jre/lib:$CLASSPATH"
38 CLASSPATH="$root/$( pkgprefix $jdk )/lib:$CLASSPATH"
39 PATH="$root/$( pkgprefix $jdk )/jre/bin:$PATH"
40 PATH="$root/$( pkgprefix $jdk )/bin:$PATH"
42 echo_status "JAVA_HOME set to $jdk"
43 export JAVA_HOME CLASSPATH PATH
45 # Determine the java version.
46 # Todo: might be important to some packages.
52 # and remove the junk i injected
53 unset jdk JAVA_EVERYJDK