• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Apache Ant didn't include resource into my classpath?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic