Bug 36663 - setclasspath.bat requires that JAVA_HOME points to a JDK
Summary: setclasspath.bat requires that JAVA_HOME points to a JDK
Status: RESOLVED DUPLICATE of bug 32081
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Unknown (show other bugs)
Version: 5.5.9
Hardware: All Windows 2000
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-15 08:22 UTC by Stefan Wachter
Modified: 2006-10-07 14:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Wachter 2005-09-15 08:22:29 UTC
Tomcat 5.5 is able to run with a JRE. Yet, the setclasspath.bat file requires
that the JAVA_HOME environment variable points to a complete JDK. Here are the
corresponding lines from setclasspath.bat

if not "%JAVA_HOME%" == "" goto gotJavaHome

echo The JAVA_HOME environment variable is not defined

echo This environment variable is needed to run this program

goto exit

:gotJavaHome

if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome

if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome

if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome

if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome

goto okJavaHome

:noJavaHome

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

goto exit

:okJavaHome
Comment 1 dagi 2005-10-06 09:04:08 UTC
I think this bug is critical, because Tomcat 5.5.9 can`t run on JRE. If someone
need help now, it is possible comment affected lines in setclasspath.bat.

My patched setclasspath.bat

rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat,v 1.7 2004/07/26 15:34:31 yoavs Exp $
rem ---------------------------------------------------------------------------

rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo The JAVA_HOME environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome
rem if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome
rem if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
goto okJavaHome
:noJavaHome
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
goto exit
:okJavaHome

if not "%BASEDIR%" == "" goto gotBasedir
echo The BASEDIR environment variable is not defined
echo This environment variable is needed to run this program
goto exit
:gotBasedir
if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir
echo The BASEDIR environment variable is not defined correctly
echo This environment variable is needed to run this program
goto exit
:okBasedir

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
rem 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="%JAVA_HOME%\bin\java"
set _RUNJAVAW="%JAVA_HOME%\bin\javaw"
rem set _RUNJDB="%JAVA_HOME%\bin\jdb"
rem set _RUNJAVAC="%JAVA_HOME%\bin\javac"

goto end

:exit
exit /b 1

:end

Comment 2 Yoav Shapira 2005-10-13 06:09:24 UTC
It's not critical because this script is not required for proper Tomcat
operation.  Please submit your changes as a diff rather than the whole file.
Comment 3 Gary Hirschhorn 2006-08-08 18:37:07 UTC
(In reply to comment #2)
> It's not critical because this script is not required for proper Tomcat
> operation.  Please submit your changes as a diff rather than the whole file.

It may not be critical, but to someone unfamiliar with Tomcat, it is
inconsistent with the file "RUNNING.TXT", which gives very simple instructions
that simply won't work as described.

Either the script should be changed as suggested, or the documentation changed.
Unfortunately, in its current state it potentially turns off new users to Tomcat.
Comment 4 Mark Thomas 2006-10-07 14:13:59 UTC

*** This bug has been marked as a duplicate of 32081 ***