source: greenstone3/branches/customizingGreenstone3/resources/tomcat/setclasspath.sh@ 15191

Last change on this file since 15191 was 15191, checked in by dmn, 16 years ago

updating branch from trunk

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1#!/bin/sh
2# -----------------------------------------------------------------------------
3# Set CLASSPATH and Java options
4#
5# $Id: setclasspath.sh 15191 2008-04-14 04:20:45Z dmn $
6# -----------------------------------------------------------------------------
7
8# First clear out the user classpath
9CLASSPATH=$CLASSPATH
10
11# Make sure prerequisite environment variables are set
12if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
13 # Bugzilla 37284
14 if $darwin && [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then
15 export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home"
16 else
17 echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
18 echo "At least one of these environment variable is needed to run this program"
19 exit 1
20 fi
21fi
22if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
23 echo "JAVA_HOME should point to a JDK in order to run in debug mode."
24 exit 1
25fi
26if [ -z "$JRE_HOME" ]; then
27 JRE_HOME="$JAVA_HOME"
28fi
29
30# If we're running under jdb, we need a full jdk.
31if [ "$1" = "debug" -o "$1" = "javac" ] ; then
32 if [ "$os400" = "true" ]; then
33 if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
34 echo "The JAVA_HOME environment variable is not defined correctly"
35 echo "This environment variable is needed to run this program"
36 echo "NB: JAVA_HOME should point to a JDK not a JRE"
37 exit 1
38 fi
39 else
40 if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
41 echo "The JAVA_HOME environment variable is not defined correctly"
42 echo "This environment variable is needed to run this program"
43 echo "NB: JAVA_HOME should point to a JDK not a JRE"
44 exit 1
45 fi
46 fi
47fi
48if [ -z "$BASEDIR" ]; then
49 echo "The BASEDIR environment variable is not defined"
50 echo "This environment variable is needed to run this program"
51 exit 1
52fi
53if [ ! -x "$BASEDIR"/bin/setclasspath.sh ]; then
54 if $os400; then
55 # -x will Only work on the os400 if the files are:
56 # 1. owned by the user
57 # 2. owned by the PRIMARY group of the user
58 # this will not work if the user belongs in secondary groups
59 eval
60 else
61 echo "The BASEDIR environment variable is not defined correctly"
62 echo "This environment variable is needed to run this program"
63 exit 1
64 fi
65fi
66
67# Set the default -Djava.endorsed.dirs argument
68JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
69
70# Set standard CLASSPATH
71if [ "$1" = "debug" -o "$1" = "javac" ] ; then
72 CLASSPATH="$JAVA_HOME"/lib/tools.jar:$CLASSPATH
73fi
74
75# OSX hack to CLASSPATH
76JIKESPATH=
77if [ `uname -s` = "Darwin" ]; then
78 OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
79 if [ -d "$OSXHACK" ]; then
80 for i in "$OSXHACK"/*.jar; do
81 JIKESPATH="$JIKESPATH":"$i"
82 done
83 fi
84fi
85
86# Set standard commands for invoking Java.
87 _RUNJAVA="$JRE_HOME"/bin/java
88if [ "$os400" != "true" ]; then
89 _RUNJDB="$JAVA_HOME"/bin/jdb
90fi
91_RUNJAVAC="$JAVA_HOME"/bin/javac
Note: See TracBrowser for help on using the repository browser.