aspose file tools*
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 Spring in Action this week in the Spring 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: 5837
    
    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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ANT: run Java code