1. Ensure that any user defined CLASSPATH variables are not used on startup
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 14 Jul 2009 00:01:01 +0000 (00:01 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 14 Jul 2009 00:01:01 +0000 (00:01 +0000)
(as is already implemented since rev.303663),
but now allow them to be specified in setenv.sh, in rare case when it is needed.

2. When preparing the CLASSPATH, do not treat the "debug" command specially,
because jdb does not need the tools.jar file.

3. Remove some wrong quotes in tool-wrapper.bat.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@793757 13f79535-47bb-0310-9956-ffa450edef68

bin/catalina.bat
bin/catalina.sh
bin/setclasspath.bat
bin/setclasspath.sh
bin/tool-wrapper.bat
bin/tool-wrapper.sh

index 8eb8dfa..64672bb 100755 (executable)
@@ -88,6 +88,10 @@ echo This environment variable is needed to run this program
 goto end
 :okHome
 
+rem Ensure that any user defined CLASSPATH variables are not used on startup,
+rem but allow them to be specified in setenv.bat, in rare case when it is needed.
+set CLASSPATH=
+
 rem Get standard environment variables
 if "%CATALINA_BASE%" == "" goto gotSetenvHome
 if exist "%CATALINA_BASE%\bin\setenv.bat" call "%CATALINA_BASE%\bin\setenv.bat"
@@ -107,6 +111,8 @@ call "%CATALINA_HOME%\bin\setclasspath.bat" %1
 if errorlevel 1 goto end
 
 rem Add on extra jar file to CLASSPATH
+rem Note that there are no quotes as we do not want to introduce random
+rem quotes into the CLASSPATH
 if "%CLASSPATH%" == "" goto emptyClasspath
 set CLASSPATH=%CLASSPATH%;
 :emptyClasspath
index ad72ca2..0b9d7a4 100755 (executable)
@@ -103,6 +103,10 @@ PRGDIR=`dirname "$PRG"`
 # Only set CATALINA_HOME if not already set
 [ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
 
+# Ensure that any user defined CLASSPATH variables are not used on startup,
+# but allow them to be specified in setenv.sh, in rare case when it is needed.
+CLASSPATH=
+
 if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
   . "$CATALINA_BASE"/bin/setenv.sh
 elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
index 62404d9..ffa2213 100755 (executable)
@@ -67,14 +67,6 @@ rem Set the default -Djava.endorsed.dirs argument
 set JAVA_ENDORSED_DIRS=%BASEDIR%\endorsed
 :gotEndorseddir
 
-rem Set standard CLASSPATH
-rem Note that there are no quotes as we do not want to introduce random
-rem quotes into the CLASSPATH
-if not exist "%JAVA_HOME%\lib\tools.jar" goto noJavac
-if not ""%1"" == ""debug"" goto noJavac
-set CLASSPATH=%JAVA_HOME%\lib\tools.jar
-:noJavac
-
 rem Set standard command for invoking Java.
 rem Note that NT requires a window name argument when using start.
 rem Also note the quoting as JAVA_HOME may contain spaces.
index e9a59de..4c559f2 100755 (executable)
@@ -21,9 +21,6 @@
 #  $Id$
 # -----------------------------------------------------------------------------
 
-# First clear out the user classpath
-CLASSPATH=
-
 # Make sure prerequisite environment variables are set
 if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
   # Bugzilla 37284 (reviewed).
@@ -101,13 +98,6 @@ if [ -z "$JAVA_ENDORSED_DIRS" ]; then
   JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed
 fi
 
-# Set standard CLASSPATH
-if [ "$1" = "debug" ] ; then
-  if [ -f "$JAVA_HOME"/lib/tools.jar ]; then
-    CLASSPATH="$JAVA_HOME"/lib/tools.jar
-  fi
-fi
-
 # OSX hack to CLASSPATH
 JIKESPATH=
 if [ `uname -s` = "Darwin" ]; then
index 5393d73..6a7561d 100755 (executable)
@@ -45,6 +45,10 @@ echo This environment variable is needed to run this program
 goto end
 :okHome
 
+rem Ensure that any user defined CLASSPATH variables are not used on startup,
+rem but allow them to be specified in setenv.bat, in rare case when it is needed.
+set CLASSPATH=
+
 rem Get standard environment variables
 if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
 
@@ -58,11 +62,13 @@ set BASEDIR=%CATALINA_HOME%
 call "%CATALINA_HOME%\bin\setclasspath.bat"
 
 rem Add on extra jar files to CLASSPATH
+rem Note that there are no quotes as we do not want to introduce random
+rem quotes into the CLASSPATH
 if "%CLASSPATH%" == "" goto noclasspath
-set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;"%BASEDIR%"\lib\servlet-api.jar
-goto :okclasspath
+set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar;%BASEDIR%\lib\servlet-api.jar
+goto okclasspath
 :noclasspath
-set CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;"%BASEDIR%"\lib\servlet-api.jar
+set CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%BASEDIR%\lib\servlet-api.jar
 :okclasspath
 
 rem Get remaining unshifted command line arguments and save them in the
index d94a716..89acc66 100755 (executable)
@@ -55,6 +55,11 @@ done
 # Get standard environment variables
 PRGDIR=`dirname "$PRG"`
 CATALINA_HOME=`cd "$PRGDIR/.." ; pwd`
+
+# Ensure that any user defined CLASSPATH variables are not used on startup,
+# but allow them to be specified in setenv.sh, in rare case when it is needed.
+CLASSPATH=
+
 if [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
   . "$CATALINA_HOME"/bin/setenv.sh
 fi