ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Michael Caine" <>
Subject RE: "jar"/zip problem
Date Fri, 22 Jun 2001 18:28:06 GMT
thank you all for the suggestions.  i wish they helped, but unfortunately
they didn't.  just to approach the simplified problem systematically:

	jar cf test.jar *.class

run from within a directory containing .classes, works fine.

then, i wish to run 'ant', with a simple buildfile:

	<project name="test" default="dist">
		<target name="dist">
		<jar jarfile="test.jar" basedir="."/>

which gives the error message (i'll print that below).  so, i take babramo's

	<project name="test" default="dist">
		<target name="dist">
		<jar jarfile="./test.jar" basedir="." includes="**"/>

and get the same message.  so, i take Chandra's suggestion:

	<project name="test" default="dist">
		<target name="dist">
		<jar jarfile="./test.jar" basedir=".">
			<fileset dir="." includes "*.class"/>

and this tells me "attribute name "fileset" must be followed by the '='
character".  i'd suspect depricated software but it's version 1.3.  isn't
the syntax correct?  am i missing something stupid?  (it's the same if i
take out the basedir= assignment, by the way, to make it look exactly like
an example)


thank you.

-----Original Message-----
From: []
Sent: Wednesday, June 20, 2001 1:06 PM
Subject: RE: "jar"/zip problem

try this
<target name="dist" depends="compile">
	<jar jarfile="${basedir}/build/it.jar"
	     includes="${basedir}/build/**" />
hope it helps

-----Original Message-----
From: J. Michael Caine []
Sent: Wednesday, June 20, 2001 6:06 PM
Subject: "jar"/zip problem

i was running 1.2-1 (the only version for which i found a Debian package).
compilations and such seemed to work fine, but the "jar" task was failing,
giving me:

"Problem creating jar: ZIP file must have at least one entry"
<rest of stack trace>

so i just installed 1.3, the latest binaries, and pointed to that.  again,
it worked fine, except for the "jar" task.  so i suspect there's something
wrong with my syntax, but it sure looks a lot like the example code.  i

<target name="dist" depends="compile">
	<jar jarfile="${basedir}/build/it.jar" basedir="${basedir}/build"/>

could it be a problem with my java?  i have J2SDK 1.3.0-2.

oh, of course, there are .class files (only) in ${basedir}/build/.  i
checked that.

View raw message