Index: catalina.sh =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/bin/catalina.sh,v retrieving revision 1.17 diff -u -r1.17 catalina.sh --- catalina.sh 17 Nov 2004 20:17:46 -0000 1.17 +++ catalina.sh 10 Jan 2005 17:45:46 -0000 @@ -1,4 +1,3 @@ -#!/bin/sh # ----------------------------------------------------------------------------- # Start/Stop Script for the CATALINA Server # @@ -18,6 +17,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 +75,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 +131,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 +145,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 +166,6 @@ fi if [ "$1" = "debug" ] ; then - if $os400; then echo "Debug command not available on OS400" exit 1 Index: setclasspath.sh =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-catalina/catalina/src/bin/setclasspath.sh,v retrieving revision 1.10 diff -u -r1.10 setclasspath.sh --- setclasspath.sh 17 Nov 2004 20:17:46 -0000 1.10 +++ setclasspath.sh 10 Jan 2005 17:34:42 -0000 @@ -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