ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject Re: running a jar file...
Date Sat, 07 Apr 2001 03:10:13 GMT

I don't think this is possible right now but it is something that can and
should be done. It would mean the java task taking a jar attribute,
perhaps, from which the manifest would need to be read to determine the
main class. That jar could be added to the classpath automagically and
perhaps even other jars from the manifest's classpath information.

For now, you will need to determine the class that is run manually, by
examining the manifest file in the jar and then give that as the classname
to the <java> task, also including the jar in the classpath. Not elegant
but a workaround for now, hopefully.

Could you please fill out an enhancement request on bugzilla for this


----- Original Message -----
From: "Isaac Sparrow (Staff Engineer)" <>
To: <>
Sent: Saturday, April 07, 2001 10:24 AM
Subject: running a jar file...

> I've been trying for some time now to define a target that will run my
> newly built project. The problem I'm running into is that I can't figure
> out how to run a jar file from ant.
> <target name="run">
>    <java classname="what goes here?" fork="yes" dir="${dist}/lib">
>       <classpath refid="project-classpath"/>
>    </java>
> </target>
> The jar file is named: Name-${DSTAMP}.jar. From the command line I can
> run it like this:
> java -jar Name-20010406.jar
> Any help on running the jar from ant would be appreciated.
> NOTE: I'm using jdk 1.3.0_02 on Linux
> Ant version 1.3 compiled on March 22 2001
> Thanks,
> --Isaac Sparrow
> --------------------------
> Staff Engineer
> VisiComp, Inc.

View raw message