This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes ANT: run Java code 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 » Engineering » Ant, Maven and Other Build Tools
Bookmark "ANT: run Java code" Watch "ANT: run Java code" New topic
Author

ANT: run Java code

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
I have the following folder strcuture for my Java application

Using an ANT script, I need to compile and run the code. DmsCheckinDoc.java contains the main method.
folders "lib" and "resources" should be in classpath.

this is the ant script that I have written

build.xml


build.properties

the code compiles fine but when I run it, I get the following error

Please let me know how to resolve this.

thank you
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

The targets in the build script have no dependencies. How are you running Ant? Hopefully as:

ant compile jar run

Does the DmsOperations.jar file appear in the lib directory? What is it's contents? (You can find that out by running "jar -tf lib/DmsOperations.jar")

Also, try running Ant with the -v option - this might give you more information about what is going on.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ANT: run Java code
 
Similar Threads
MySQL with ant: can not find driver class
Apache Ant add property file and policy file
Building Seam projects in Eclipse
Build problem when including third party jars in classpath using ant
could not find the main class