ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Re: Stupid Windows question
Date Tue, 02 Jan 2001 21:02:24 GMT
See below ...

James Bucanek wrote:
> At 2:01 PM -0500 1/2/01, Bill Burton wrote:
> >Hello James,
> >
> >You could try using what is known as "Download Extensions."  This allows
> >one jar file to reference jars elsewhere, normally using a relative
> >reference.
> >
> >Rebuild MyAntTool.jar adding a manifest entry something like this:
> >   Class-Path: ant.jar jaxp.jar parser.jar optional.jar
> >
> >Now, as long as MyAntTool.jar and all these jars listed in the Class-Path
> >directive are located in the same directory, MyAntTool.jar will be able to
> >find them as necessary.  For more information, see
> >
> This would work if the ant.jar (etc.) jars were together with my
> application, but I really wanted that kind of stuff to be installed
> as common resources on the workstation, independent of my tool or any
> of my projects.  Well, I can see advantages and disadvantages to both
> ways, and this would certainly make some things easier.  Thanks for
> the tip.

Your MyAntTool.jar doesn't have to look for the other jars in the same
directory.  If it was located in a directory parallel to the Ant
directory, you could use a relative path to each jar:
  Class-Path: ../jakarta-ant/lib/ant.jar ...

Also, some on this list have mentioned checking into their source code
management system the relevent parts of Ant with each project.  That way,
they always have the right version of Ant that can build that project. 
When a new version of Ant comes out, they can then upgrade each project
independently without affecting the others.  This is even more important
if you've written custom tasks for a project.

> >
> >However, there are other problems invoking Ant with the -jar option:
> >1. Ant needs the property ant.home set to the installation directory of
> >Ant.  Since you're using a 1.3 JVM this may not be a requirement but I'm
> >not sure.
> I've never set the ant.home property, nor does it appear that Ant
> sets it internally either.  What does Ant use the ant.home property
> for?  Remember that I'm using the released Ant 1.2, so maybe ant.home
> is new feature.

Since you're using a 1.3 JVM, it might not be necessary.  The reason is,
the "dir" attribute of the <exec> task uses different methods of switching
the current directory before invoking the specified external command.  If
you were using 1.2 or earlier JVM, then Ant would need to find the
bin\antRun.bat file which is done by looking at the value of ant.home.

The ant.home property is part of version 1.2 and has been around since at
least version 1.1 if not earlier.  Look at ant.bat and you'll see it being
defined on the Java command line.

> >2. Ant needs to be able to find the SDK's tools.jar.  This is normally
> >done by setting the JAVA_HOME variable to point to the JDK/SDK directory
> >before running ant.bat.
> I assume that ant needs access to the tools.jar archive for things
> like javac?  Well, my Ant tool isn't using any of the Java tools at
> the moment, so I can probably safely ignore this for the time being.

That's fine.

-Bill Burton

> __________________________________
> James Bucanek
> <>

View raw message