Meaningless Drivel is fun!*
The moose likes Swing / AWT / SWT and the fly likes Apache Ant didn't include resource into my classpath? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Apache Ant didn Watch "Apache Ant didn New topic
Author

Apache Ant didn't include resource into my classpath?

Roger Lim
Greenhorn

Joined: May 14, 2006
Posts: 2
hi guys,

i have this package

view/MyFrame.java
view/res/home.gif

In MyFrame.java, i try to load the image using
ImageIcon ic = new ImageIcon("view/res/home.gif");

using eclipse ide, everything works fine, but when i use ant script to do the job, the image didn't appear.

my build xml
...
<property name="sourcedir" value="${basedir}/src"/>
<property name="targetdir" value="${basedir}/bin"/>

<target name="run" depends="compile">
<java fork="true" classname="view.MyFrame">
<classpath>
<pathelement path="${targetdir}"/>
</classpath>
</java>
</target>

i did copy the resource to my targetdir during compilation. Anyone has any idea what is wrong? thank you!
[ September 22, 2007: Message edited by: Roger Lim ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache Ant didn't include resource into my classpath?
 
Similar Threads
NoClassDefFoundError
Problem with Ant Build
Could not parse configuration: /hibernate.cfg.xml
could not find the main class
how to tell ant that some packages are needed?