Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ANT: run Java code

 
Anjali S Sharma
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic