Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issues with setting classpath in Ant BuildScript

 
Varshini Priya
Ranch Hand
Posts: 95
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have some issues in setting the classpath for the a project for which Im trying to create a jar using the Ant build script. For eg: Consider a project A in the workspace. This project has internal dependencies with other projects in the workspace. There are project B, C, D in my workspace, which are added to the build path of the Project A. I have the below compile script in the build.xml. When I try to execute the script, the compile does not seem to happen, due to issues with classpath. Please find the code below.



When I try to execute the script, I get the error at this line '<javac srcdir="../A/src" destdir="${Classfiles}" />' saying that compilation fails. Require help in setting the classpath in the buildscript. Thanks in Advance
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should reference the bin directory, not the src directory, in the classpath (assuming you kept the default location for the compiled files), example:



Also, you have to make sure that the projects B, C and D are compiled before you can run the build for A. (You might need a master script that builds the projects in the correct order.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic