You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ian McFarland <ia...@neo.com> on 2001/05/18 02:06:40 UTC
Problem loading resources from task
Greetings,
I'm working on some code to automate generation of Mac OS X applications
from Ant, and have run into the following problem:
My app reads two binary files stored inside its jar file, and writes
them to the filesystem. It does this by calling
foo.getClass().getResource("bar");
The app works great when run from the command line:
java -classpath lib/auntiemac.jar:lib/jdom.jar \
com.neo.util.dev.AuntieMac \
com.neo.util.dev.AuntieMac \
default "Auntie Mac" default default default
produces exactly the desired results. The URLs returned by getResource
are valid, and everything proceeds smoothly. The URLs returned by
resources are:
jar:file:/Volumes/Graphite/Users/imf/projects/auntiemac/lib/auntiemac.jar!
/resources/JavaApplicationStub
and
jar:file:/Volumes/Graphite/Users/imf/projects/auntiemac/lib/auntiemac.jar!
/resources/auntiemac-default.icns
When however I use the same exact JAR file from within ant:
<target name="mac" depends="build">
<java classname="com.neo.util.dev.AuntieMac"
classpath="lib/auntiemac.jar:lib/jdom.jar">
<arg value="${mainclass}" />
<arg value="${build.osx.app}" />
<arg value="${Name}" />
<arg value="${auntiemac.creator}" />
<arg value="${name}" />
<arg value="${auntiemac.region}" />
<arg value="${auntiemac.iconfile}" />
</java>
.
.
.
</target>
the URLs returned by getResource() are both null.
So... Any thoughts?
I'd really like to be able to finish this app up. It's going to be open
source, and should make it trivial to build well-packaged OS X apps from
ant.
Thanks in advance,
-Ian McFarland