A
Ann
New to ant, I am.
This seems like it should be simple, but I have
not been able to find it in the ant documentation.
If it is there, a pointer will suffice.
I built a jar file that includes two gif files.
The gif files are actually in the jar file.
The names of the gif files are in
META-INF/INDEX.LIST
One of the classes uses the gif files like this:
ImageIcon leafIcon = new ImageIcon("TABLE_ICON.gif");
I run the jar file: "java -jar NewDraw.jar"
It runs fine, but the gif files don't show up,
it appears it is not finding them and using the default.
If I extract the gif files into the same directory
as the jar file, they are found and used.
What change is needed to avoid the extraction?
Here is my bulid.xml file
-------------------------------
<project name="NewDraw" default="compile" basedir=".">
<target name="compile">
<javac srcdir="src"
destdir="bin"
debug="on"
/>
</target>
<target name="jar" depends="compile">
<jar destfile="NewDraw.jar"
basedir="bin"
includes="**/*.class"
index="true"<fileset dir="src"
includes="**/*ICON*.gif"
/>
<fileset dir="src"
includes="fileNotFound.jpg"
/>
<fileset dir="src"
includes="viewlist.txt"
/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="NewDraw"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java classname="NewDraw"
classpath="NewDraw.jar"
fork="true"
/>
</target>
</project>
This seems like it should be simple, but I have
not been able to find it in the ant documentation.
If it is there, a pointer will suffice.
I built a jar file that includes two gif files.
The gif files are actually in the jar file.
The names of the gif files are in
META-INF/INDEX.LIST
One of the classes uses the gif files like this:
ImageIcon leafIcon = new ImageIcon("TABLE_ICON.gif");
I run the jar file: "java -jar NewDraw.jar"
It runs fine, but the gif files don't show up,
it appears it is not finding them and using the default.
If I extract the gif files into the same directory
as the jar file, they are found and used.
What change is needed to avoid the extraction?
Here is my bulid.xml file
-------------------------------
<project name="NewDraw" default="compile" basedir=".">
<target name="compile">
<javac srcdir="src"
destdir="bin"
debug="on"
/>
</target>
<target name="jar" depends="compile">
<jar destfile="NewDraw.jar"
basedir="bin"
includes="**/*.class"
index="true"<fileset dir="src"
includes="**/*ICON*.gif"
/>
<fileset dir="src"
includes="fileNotFound.jpg"
/>
<fileset dir="src"
includes="viewlist.txt"
/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="NewDraw"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java classname="NewDraw"
classpath="NewDraw.jar"
fork="true"
/>
</target>
</project>