startup.bat改为如下: @echo off if "%OS%" == "Windows_NT" setlocal rem --------------------------------------------------------------------------- rem Start script for the CATALINA Server rem rem $Id: startup.bat,v 1.3.4.2 2002/01/30 18:10:40 patrickl Exp $ rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not defined if not "%CATALINA_HOME%" == "" goto gotHome set CATALINA_HOME=. if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome set CATALINA_HOME=.. :gotHome if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome echo The CATALINA_HOME environment variable is not defined correctly echo This environment variable is needed to run this program goto end :okHomeset EXECUTABLE=%CATALINA_HOME%\bin\catalina.batrem Check that target executable exists if exist "%EXECUTABLE%" goto okExec echo Cannot find %EXECUTABLE% echo This file is needed to run this program goto end :okExecrem Get remaining unshifted command line arguments and save them in the set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 shift goto setArgs :doneSetArgscall "%EXECUTABLE%" start %CMD_LINE_ARGS%cd.. cd webapps\ROOT\ :end
setclasspath.bat改为如下: rem --------------------------------------------------------------------------- rem Set CLASSPATH and Java options rem rem $Id: setclasspath.bat,v 1.1.2.3 2002/01/30 23:08:28 patrickl Exp $ rem --------------------------------------------------------------------------- set JAVA_HOME=c:\j2sdk 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 end :gotJavaHome if exist "%JAVA_HOME%\bin\java.exe" goto okJavaHome echo The JAVA_HOME environment variable is not defined correctly echo This environment variable is needed to run this program goto end :okJavaHomeif not "%BASEDIR%" == "" goto gotBasedir echo The BASEDIR environment variable is not defined echo This environment variable is needed to run this program goto end :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 end :okBasedirrem Set the default Java options for all scripts set JAVA_OPTS=rem Set the default -Djava.endorsed.dirs argument set JAVA_ENDORSED_DIRS=%BASEDIR%\bin;%BASEDIR%\common\librem 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;%BASEDIR%\webapps\ROOT\WEB-INF\classes;%BASEDIR%\webapps\ROOT\WEB-INF\classes\ias.jar;%BASEDIR%\webapps\ROOT\WEB-INF\classes\inetfactory.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" set _RUNJDB="%JAVA_HOME%\bin\jdb"
%JAVA_HOME%\lib
JAVA_HOME
C:\Program Files\j2sdk_nb\j2sdk1.4.2(这个地方就是你装jdk的路径了)
PATH
%JAVA_HOME%\bin(在path后或前加上这句记得用;搁开)
至于tomcat是不用设置环境变量的,只是在装的时候找到jdk的路径就可以了。
当然也可以装jike之类的编译器。
@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem
rem $Id: startup.bat,v 1.3.4.2 2002/01/30 18:10:40 patrickl Exp $
rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not defined
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=.
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
set CATALINA_HOME=..
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHomeset EXECUTABLE=%CATALINA_HOME%\bin\catalina.batrem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find %EXECUTABLE%
echo This file is needed to run this program
goto end
:okExecrem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgscall "%EXECUTABLE%" start %CMD_LINE_ARGS%cd..
cd webapps\ROOT\
:end
rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat,v 1.1.2.3 2002/01/30 23:08:28 patrickl Exp $
rem ---------------------------------------------------------------------------
set JAVA_HOME=c:\j2sdk
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 end
:gotJavaHome
if exist "%JAVA_HOME%\bin\java.exe" goto okJavaHome
echo The JAVA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okJavaHomeif not "%BASEDIR%" == "" goto gotBasedir
echo The BASEDIR environment variable is not defined
echo This environment variable is needed to run this program
goto end
: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 end
:okBasedirrem Set the default Java options for all scripts
set JAVA_OPTS=rem Set the default -Djava.endorsed.dirs argument
set JAVA_ENDORSED_DIRS=%BASEDIR%\bin;%BASEDIR%\common\librem 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;%BASEDIR%\webapps\ROOT\WEB-INF\classes;%BASEDIR%\webapps\ROOT\WEB-INF\classes\ias.jar;%BASEDIR%\webapps\ROOT\WEB-INF\classes\inetfactory.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"
set _RUNJDB="%JAVA_HOME%\bin\jdb"