source: trunk/gsdl3/packages/tomcat-extra/setclasspath.sh@ 10811

Last change on this file since 10811 was 10811, checked in by kjdon, 18 years ago

moved these files here from comms/jakarta

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