You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/07/17 12:41:20 UTC

svn commit: r795032 - in /tomcat/container/tc5.5.x: catalina/src/bin/catalina.bat catalina/src/bin/catalina.sh catalina/src/bin/setclasspath.bat catalina/src/bin/setclasspath.sh webapps/docs/changelog.xml

Author: markt
Date: Fri Jul 17 10:41:20 2009
New Revision: 795032

URL: http://svn.apache.org/viewvc?rev=795032&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=39194
Make classpath setting consistent across scripts

Modified:
    tomcat/container/tc5.5.x/catalina/src/bin/catalina.bat
    tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh
    tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.bat
    tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/catalina/src/bin/catalina.bat
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/bin/catalina.bat?rev=795032&r1=795031&r2=795032&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/bin/catalina.bat (original)
+++ tomcat/container/tc5.5.x/catalina/src/bin/catalina.bat Fri Jul 17 10:41:20 2009
@@ -63,6 +63,10 @@
 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"
@@ -81,8 +85,13 @@
 call "%CATALINA_HOME%\bin\setclasspath.bat" %1
 if errorlevel 1 goto end
 
-rem Add on extra jar files to CLASSPATH
-set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
+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
+set CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar
 
 if not "%CATALINA_BASE%" == "" goto gotBase
 set CATALINA_BASE=%CATALINA_HOME%

Modified: tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh?rev=795032&r1=795031&r2=795032&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh (original)
+++ tomcat/container/tc5.5.x/catalina/src/bin/catalina.sh Fri Jul 17 10:41:20 2009
@@ -18,7 +18,7 @@
 #                   $CATALINA_BASE/temp.
 #
 #   JAVA_HOME       Must point at your Java Development Kit installation.
-#                   Required to run the with the "debug" or "javac" argument.
+#                   Required to run the with the "debug" argument.
 #
 #   JRE_HOME        Must point at your Java Development Kit installation.
 #                   Defaults to JAVA_HOME if empty.
@@ -79,6 +79,10 @@
 # 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
@@ -126,7 +130,10 @@
 fi
 
 # Add on extra jar files to CLASSPATH
-CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar
+if [ ! -z "$CLASSPATH" ] ; then
+  CLASSPATH="$CLASSPATH":
+fi
+CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar
 
 if [ -z "$CATALINA_BASE" ] ; then
   CATALINA_BASE="$CATALINA_HOME"
@@ -170,7 +177,7 @@
   echo "Using CATALINA_BASE:   $CATALINA_BASE"
   echo "Using CATALINA_HOME:   $CATALINA_HOME"
   echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
-  if [ "$1" = "debug" -o "$1" = "javac" ] ; then
+  if [ "$1" = "debug" ] ; then
     echo "Using JAVA_HOME:       $JAVA_HOME"
   else
     echo "Using JRE_HOME:        $JRE_HOME"

Modified: tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.bat
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.bat?rev=795032&r1=795031&r2=795032&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.bat (original)
+++ tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.bat Fri Jul 17 10:41:20 2009
@@ -48,18 +48,11 @@
 rem Set the default -Djava.endorsed.dirs argument
 set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed
 
-rem Set standard CLASSPATH
-rem Note that there are no quotes as we do not want to introduce random
-rem quotes into the CLASSPATH
-set CLASSPATH=%JAVA_HOME%\lib\tools.jar
-
 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.
 set _RUNJAVA="%JRE_HOME%\bin\java"
-set _RUNJAVAW="%JRE_HOME%\bin\javaw"
 set _RUNJDB="%JAVA_HOME%\bin\jdb"
-set _RUNJAVAC="%JAVA_HOME%\bin\javac"
 
 goto end
 

Modified: tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh?rev=795032&r1=795031&r2=795032&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh (original)
+++ tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh Fri Jul 17 10:41:20 2009
@@ -5,9 +5,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
@@ -28,7 +25,7 @@
 fi
 
 # If we're running under jdb, we need a full jdk.
-if [ "$1" = "debug" -o "$1" = "javac" ] ; then
+if [ "$1" = "debug" ] ; 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"
@@ -67,11 +64,6 @@
 # Set the default -Djava.endorsed.dirs argument
 JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed
 
-# Set standard CLASSPATH
-if [ "$1" = "debug" -o "$1" = "javac" ] ; then
-  CLASSPATH="$JAVA_HOME"/lib/tools.jar
-fi
-
 # OSX hack to CLASSPATH
 JIKESPATH=
 if [ `uname -s` = "Darwin" ]; then
@@ -88,4 +80,3 @@
 if [ "$os400" != "true" ]; then
   _RUNJDB="$JAVA_HOME"/bin/jdb
 fi
-_RUNJAVAC="$JAVA_HOME"/bin/javac

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=795032&r1=795031&r2=795032&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Fri Jul 17 10:41:20 2009
@@ -36,6 +36,10 @@
   <subsection name="General">
     <changelog>
       <fix>
+        <bug>39194</bug>: Make the setting of the classpath consistent for the
+        .sh and .bat startup scripts. (markt/kkolinko) 
+      </fix>
+      <fix>
         <bug>45880</bug>: Include NOTICE file in Windows installer and make sure
         src files are excluded. (markt)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org