• 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

ant problems

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to run ant on a linux (ubuntu) box. It gets compiled, but
when it goes to run, I get an error stating that it can't find my Main
class and encourages me to have my classpath set. However, it is in set
in my build script. Also, I have things properly set in my .cshrc file,
otherwise, nothing would compile. Does anyone have any ideas???

<project name="mysecondbuild" default="execute">
<path id="run.cp">
<pathelement location="build/classes"/>
</path>
<target name="init">
<mkdir dir="build/classes"/>
<mkdir dir="dist"/>
</target>
<target name="compile" depends="init">
<javac srcdir="src" destdir="build/classes"/>
</target>
<target name="archive" depends="compile">
<jar destfile="dist/project.jar" basedir="build/classes"/>
</target>
<target name="clean" depends="init">
<delete dir="build"/>
<delete dir="dist"/>
</target>
<target name="execute" depends="compile">
<java classname="mysecond.Main.class" classpathref="run.cp">
<arg value="a"/>
<arg value="b"/>
<arg file="."/>
</java>
</target>
</project>

Thanks,

John
 
Ranch Hand
Posts: 218
VI Editor Ruby Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try setting your java classname="mysecond.Main"
 
John Gregory
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wirianto,

Yep, thanks, that did the trick!

John
 
reply
    Bookmark Topic Watch Topic
  • New Topic