This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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 ]
 
GeeCON Prague 2014
 
subject: Apache Ant didn't include resource into my classpath?