Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath for Ant program

 
Tore Sagen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this basic build.xml:


The classes are packed into catalina-ant5.jar and placed in /usr/share/ant/lib. I thought Ant should load the classes automatically, but it doesn't. Invoking Ant gives me this:



The following command doesn't help either, specifying the classpath in detail:


I could use some help, please.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you take a look at whether the jar file actually contains that class?
 
Tore Sagen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have. The result is listed below.

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't confuse the classpath for Ant itself with the classpath for the taskdef. You probably need to add a classpath definition to the task. For some tasks, I've actually had to do 2 classpaths - one for the taskdef itself and one for the defined task's execution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic