You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2005/01/10 19:16:10 UTC
cvs commit: jakarta-tomcat-catalina/catalina/src/bin catalina.sh setclasspath.sh
remm 2005/01/10 10:16:10
Modified: catalina/src/bin catalina.sh setclasspath.sh
Log:
- 32081: Remove the JDK requirement from the Unix scripts.
- I suppose a lot of Windows users will use the .exe or similar wrappers. The rest are probably developers so would have the JDK anyway.
Revision Changes Path
1.18 +12 -3 jakarta-tomcat-catalina/catalina/src/bin/catalina.sh
Index: catalina.sh
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/bin/catalina.sh,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- catalina.sh 17 Nov 2004 20:17:46 -0000 1.17
+++ catalina.sh 10 Jan 2005 18:16:10 -0000 1.18
@@ -18,6 +18,10 @@
# $CATALINA_BASE/temp.
#
# JAVA_HOME Must point at your Java Development Kit installation.
+# Required to run the with the "debug" or "javac" argument.
+#
+# JRE_HOME Must point at your Java Development Kit installation.
+# Defaults to JAVA_HOME if empty.
#
# JAVA_OPTS (Optional) Java runtime options used when the "start",
# "stop", or "run" command is executed.
@@ -72,6 +76,7 @@
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$JRE_HOME" ] && JRE_HOME=`cygpath --unix "$JRE_HOME"`
[ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
[ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"`
[ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
@@ -127,6 +132,7 @@
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
+ JRE_HOME=`cygpath --absolute --windows "$JRE_HOME"`
CATALINA_HOME=`cygpath --absolute --windows "$CATALINA_HOME"`
CATALINA_BASE=`cygpath --absolute --windows "$CATALINA_BASE"`
CATALINA_TMPDIR=`cygpath --absolute --windows "$CATALINA_TMPDIR"`
@@ -140,7 +146,11 @@
echo "Using CATALINA_BASE: $CATALINA_BASE"
echo "Using CATALINA_HOME: $CATALINA_HOME"
echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
-echo "Using JAVA_HOME: $JAVA_HOME"
+if [ "$1" = "debug" -o "$1" = "javac" ] ; then
+ echo "Using JAVA_HOME: $JAVA_HOME"
+else
+ echo "Using JRE_HOME: $JRE_HOME"
+fi
if [ "$1" = "jpda" ] ; then
if [ -z "$JPDA_TRANSPORT" ]; then
@@ -157,7 +167,6 @@
fi
if [ "$1" = "debug" ] ; then
-
if $os400; then
echo "Debug command not available on OS400"
exit 1
1.11 +32 -19 jakarta-tomcat-catalina/catalina/src/bin/setclasspath.sh
Index: setclasspath.sh
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/bin/setclasspath.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- setclasspath.sh 17 Nov 2004 20:17:46 -0000 1.10
+++ setclasspath.sh 10 Jan 2005 18:16:10 -0000 1.11
@@ -5,24 +5,35 @@
# -----------------------------------------------------------------------------
# Make sure prerequisite environment variables are set
-if [ -z "$JAVA_HOME" ]; then
- echo "The JAVA_HOME environment variable is not defined"
- echo "This environment variable is needed to run this program"
+if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
+ echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
+ echo "At least one of these environment variable is needed to run this program"
exit 1
fi
-if [ "$os400" = "true" ]; then
- if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
- echo "The JAVA_HOME environment variable is not defined correctly"
- echo "This environment variable is needed to run this program"
- echo "NB: JAVA_HOME should point to a JDK not a JRE"
- exit 1
- fi
-else
- if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
- echo "The JAVA_HOME environment variable is not defined correctly"
- echo "This environment variable is needed to run this program"
- echo "NB: JAVA_HOME should point to a JDK not a JRE"
- exit 1
+if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
+ echo "JAVA_HOME should point to a JDK in order to run in debug mode."
+ exit 1
+fi
+if [ -z "$JRE_HOME" ]; then
+ JRE_HOME="$JAVA_HOME"
+fi
+
+# If we're running under jdb, we need a full jdk.
+if [ "$1" = "debug" -o "$1" = "javac" ] ; then
+ if [ "$os400" = "true" ]; then
+ if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
+ echo "The JAVA_HOME environment variable is not defined correctly"
+ echo "This environment variable is needed to run this program"
+ echo "NB: JAVA_HOME should point to a JDK not a JRE"
+ exit 1
+ fi
+ else
+ if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
+ echo "The JAVA_HOME environment variable is not defined correctly"
+ echo "This environment variable is needed to run this program"
+ echo "NB: JAVA_HOME should point to a JDK not a JRE"
+ exit 1
+ fi
fi
fi
if [ -z "$BASEDIR" ]; then
@@ -48,7 +59,9 @@
JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
# Set standard CLASSPATH
-CLASSPATH="$JAVA_HOME"/lib/tools.jar
+if [ "$1" = "debug" -o "$1" = "javac" ] ; then
+ CLASSPATH="$JAVA_HOME"/lib/tools.jar
+fi
# OSX hack to CLASSPATH
JIKESPATH=
@@ -62,7 +75,7 @@
fi
# Set standard commands for invoking Java.
-_RUNJAVA="$JAVA_HOME"/bin/java
+ _RUNJAVA="$JRE_HOME"/bin/java
if [ "$os400" != "true" ]; then
_RUNJDB="$JAVA_HOME"/bin/jdb
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org