You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Harish Prabandham <Ha...@eng.sun.com> on 1999/11/09 22:50:33 UTC

Re: PATCH: explicit build.bat for watchdog



Costin.Manolache@eng.sun.com wrote:

> "Preston L. Bannister" wrote:
>
> > Replacement for the build.bat file in watchdog to exactly control the
> > build environment.
> > Downside is you have edit JAVA_HOME to match your installation.
>
> Is it any way to do an "if" in a BAT file?
> AFAIK, java installer sets JAVA_HOME to something, so it would be
> nice to use whatever is set ( "if" it is set :-)
>
> Also, is there any way to call a sort of sub-routine in BAT?
> Something like  TomcatEnv.BAT that will set all the env variables?

Yes there is a way.... Do something like this


if not  "%JAVA_HOME%" == "foobar" goto label
rem if block here....
goto end

:label
rem else block here...

:end
rem out of the wretched if-else loop


>
>
> That would be very usefull because you can then easily compile individual
> files (and servlets) - you have the right classpath, and it can also be
> called
> from a .bashrc file ( or whatever is the BAT equivalent ) - that saves
> typing.
>
> Since we are here, it would also be nice to have a TOMCAT_HOME env
> and do a cd - this way we might be able to start tomcat from any directory.
>
> ( I can do the sh side, but I'm not sure if it is possible on Windows,
> and we need the same "style" on both platforms )
>
> Costin
>
> >
> > FILE build.bat
> > ----
> > @echo off
> >
> > REM Explicitly specify the JDK to be used.
> >
> > REM JAVA_HOME=d:\jdk1.1.6
> > REM JAVA_HOME=d:\jdk1.1.7
> > set JAVA_HOME=d:\jdk1.1.8
> > REM JAVA_HOME=d:\jdk1.2.1
> >
> > set CLASSPATH=%JAVA_HOME%\lib\classes.zip
> > set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
> >
> > set
> > CLASSPATH_ANT=..\jakarta-tools\ant.jar;..\jakarta-tools\moo.jar;..\jakar
> > ta-tools\projectx-tr2.jar;..\jakarta-tools\servlet-2.2.0.jar;%CLASSPATH%
> >
> > REM Just so we can tell from the log which compiler we used:
> >
> > echo JAVA_HOME=%JAVA_HOME%
> > echo CLASSPATH=%CLASSPATH%
> > echo CLASSPATH_ANT=%CLASSPATH_ANT%
> >
> > %JAVA_HOME%\bin\java -version
> >
> > %JAVA_HOME%\bin\java -classpath %CLASSPATH_ANT%
> > org.apache.tools.ant.Main %*
> >
> > REM Note no attempt to clean up altered CLASSPATH.
> > REM Kind'a a lost cause as ^C will leave them in changed state.
> > ----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org