source: trunk/gsdl3/resources/tomcat/setclasspath.sh@ 11288

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

moved here from packages/tomcat-extra

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