Hi, professional developers:
I am writing the a java application using Ant, but stucked on dealing with the Ant Task.
I put the line "import org.apache.tools.ant.BuildException;" in my source code, and run "ant" in the console windows. But got the following error message,
error: Class or interface `org.apache.tools.ant.BuildException' not found in import.
error: Superclass `org.apache.tools.ant.Task' of class `com.gal lery.GalleryRemote.util.PostChangeLog' not found.
error: Class `BuildException' not found
Could someone help me to fix these bugs?
Thanks in advance.
Posts: 1479
The ant.jar file from Ant must be in your classpath when you build GR with ant.
May I inquire what you're going to use GR for, out of curiosity?
Posts: 6
Hello, paour:
Thank you very much for your replying. I am working on a java image processing project and I found Gallery Remote is really great and has some similiar funcionalities. I want to understand how Gallery Remote does the work. So I tried to build this project using Ant, but it cannot found those packages. I am using Linux with JDK1.4.2_5. and I add the three lines to the system profile and type ant in console to build the project but doesn't work.
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/home/wu/Software/j2sdk1.4.2_05
export PATH=${PATH}:${ANT_HOME}/bin
The Ant I am using was installed when I installed the Linux system.
Could you please tell me how to configure the classpath?
I really appreciate you help
Best regards!!!
Posts: 1479
Thanks for the info.
You should find 'ant.jar' using the locate command to find out where it is in your system.
Posts: 6
Thanks for your patientence:
I tried the command "locate ant.jar" in the console windows, and the result is
/usr/share/ant/lib/ant.jar
/usr/share/java/ant.jar
/home/wu/Software/Ant/ant.jar
/home/wu/Software/eclipse/eclipse/plugins/org.eclipse.core.resources_3.0.1/ant_tasks/resources-ant.jar
/home/wu/Software/eclipse/eclipse/plugins/org.eclipse.pde.ui_3.0.1/pdeuiant.jar
/home/wu/Software/eclipse/eclipse/plugins/org.eclipse.pde.build_3.0.1/lib/pdebuild-ant.jar
/home/wu/Software/eclipse/eclipse/plugins/org.apache.ant_1.6.1/lib/ant.jar
/home/wu/Software/eclipse/eclipse/plugins/org.eclipse.pde_3.0.1/ant_tasks/pde-ant.jar
Then I copied the "ant.jar" file from the first folder above to the folder /usr/local/ant
but stilll not working. Is there something wrong with those lines I added to the profile?
Thanks a lot for your replying.
Posts: 1479
I'm no longer sure I understand what you're trying to do... Are you trying to get an unmodified version of GR to build? Are you modifying it and it no longer builds?
Posts: 6
I am trying to get an unmodified version of GR to build to see how the image is processed.
I downloaded the sources form www.sourceforge.net. using CVS. but cannot build it using Ant.
so I post my question here to try to get some help from those who are familiar with Ant.
Thank you very much! :D
Posts: 1479
OK. The easier solution to that is to simply remove the com/gallery/GalleryRemote/util/PostChangeLog.java file. It's not necessary to run GR (it's used in the process that creates the nightly builds).
That should solve the ant.jar dependancy.
Posts: 6
Hi, paour
I really appreciate your help and patientence.
I followed your instruction, and it works. I got another problem that I deleted a few source files by mistake, and I want find the latest version of the source code. I went to www.souceforge.net, but its CVS server is down. Could you please tell me where else I can find the source code. It is really urgent for me.
Thanks a lot.
Best regards!
:D