ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <>
Subject RE: build.exe
Date Fri, 13 Jul 2001 01:33:13 GMT


I put together a Java-based launcher a while ago, plus a task which builds
custom application launchers.  The launchers are assembled into Jar files
that can be run with "java -jar".

A quick description of what the launcher does:

When the launcher starts up, it builds up a classpath from the system
classpath, plus whatever .jar and .zip files it finds in various
directories.  The directories to search are customisable, and can be
specified as an absolute path, a path relative to the working dir, or a path
relative to the directory containing the launcher Jar.

It includes some hackery to locate tools.jar and add it to the classpath, if

Once the classpath is built, the launcher invokes the main() method of the
app's main class.  The main class name is customisable.

I have used the task to build launchers for a bunch of apps, including ant.
No need to set JAVA_HOME or ANT_HOME - it figures it all out.

I feel it would be useful for ant to provide a task like this.  Every Java
app has - to some degree or other - the same problems that ant has with
launching itself.  Whatever solution ant comes up with, we should try to
make generally available.

I can send in what I have.  It needs some work to fit a little better with
ant.  In particular, it uses some Java 2 stuff, to locate the launcher Jar,
and to build a classloader.  I think AntClassLoader could be used instead
(need to abstract out the dependency on a Project).


> -----Original Message-----
> From: Conor MacNeill []
> Sent: Sunday, 8 July 2001 9:26 AM
> To:
> Subject: Re: build.exe
> From: "Nico Seessle" <>
> > Others: Do you think it would be useful to add this (as ant.exe) to the
> Ant
> > Distribution, so we can avoid future problems with ant.bat?
> >
> I'm happy to have it in there as source, but I think the real solution is
> to move this processing into Java code, not C++. That is the
> approach taken
> by most of the Ant2 proposals. I might play around with a Java based
> launcher.
> Conor

View raw message