tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Luby <>
Subject Re: cvs commit: jakarta-tomcat-5 build2.xml
Date Sun, 04 Aug 2002 19:15:01 GMT
Costin, wrote:
> You'll have to submit patches to ant-dev. 

I expected that.

> But you can very well do the same thing with the current ant1.5 types - 
> the syntax may be a bit more complicated, but using multiple <sysproperty> instead
of <syspropertyset> is not that critical.
> Same for the conditionals - you can do most of that in the current 
> syntax ( using conditional targets ). Not the cleanest way - but 
> it works.

True. But the conditionals are really convenient for turning certain 
<sysproperty> elements on and off (e.g. JPDA or security manager 

>>This piece of code deserves more explanation. In the launcher, this 
>>bootstrapper is called LauncherBootstrap.class and resides in the same 
>>directory as the shell script that users use. Then, in Windows batch 
>>scripts, you put %0\..;"%PATH%" as the classpath when invoking Java. 
>>Since Windows sometimes makes %0 meaningless, %PATH% is used as the 
>>classpath. Since LauncherBootstrap.class is an unjarred class in %PATH% 
>>(since it is in the same directory as the script), it will get included 
>>in the classpath. LauncherBootstrap.class then just loads ant.jar since 
>>Java can reliably determine which directory LauncherBootstrap.class was 
>>loaded from.
> Can't you just do 'java -jar ./bootstrap.jar' ? 

Your command works if the current working directory is the same 
directory that the jar file is in. Since a lot of people put scripts in 
their %PATH%, you can never really be sure what directory they are in. 
So, the bootstrap class is a way to catch this.

> Or we can require TOMCAT_HOME/ANT_HOME env to be set. Or a registry
> key. Or use a small C program. Or we can 'install' a small bootstrap.jar 
> in java's lib/ext. There are many hacks - what's important is to not let 
> the hack affect the design and other platforms.

I agree. However, that is why the bootstrap class is unnecessary for 
Unix and later Windows platforms. It is merely a "helper" class  for a 
specific circumstance: executing Windows batch files. This class can be 
compiled separately (i.e. with no interdependencies) from Ant or the 
Launcher classes.

A small C program is really the same solution just a different language. 
I must say that I am not fond of the TOMCAT_HOME/ANT_HOME environment 
variable solution as this trips up a lot of Windows users of Tomcat. 
They either set it incorrectly or they have it set to another Tomcat 
installation and then they cannot figure out why Tomcat won't start. So, 
I came up with the bootstrap class to eliminate this dependency on the 
user getting the environment variable set correctly.

> Not sure what that means. Other application can start and kill ant - 
> there is no need for anything special.

True, if you start Ant in a separate process. However, if you invoke 
Ant's Main.start() method, Ant invokes System.exit(). The Launcher's 
start() and stop() methods were designed for application's that run Ant 
in the same JVM.

> That would require a lot of work in ant, but I think it's a good idea.

My initial plan was to make the localized property retrieval methods 
available and, over time, individual tasks may choose to replace their 
hard-coded English strings with calls to the localized property 
retrieval method.


Patrick Luby                     Email:
Sun Microsystems                         Phone: 408-276-7471
901 San Antonio Road, USCA14-303
Palo Alto, CA 94303-4900

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message