About the Package "org.apache.tools.ant.BuildException&

wusun

Joined: 2004-08-10
Posts: 6
Posted: Tue, 2004-08-17 19:44

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.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2004-08-17 21:16

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?

 
wusun

Joined: 2004-08-10
Posts: 6
Posted: Tue, 2004-08-17 22:56

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!!!

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2004-08-17 23:26

Thanks for the info.

You should find 'ant.jar' using the locate command to find out where it is in your system.

 
wusun

Joined: 2004-08-10
Posts: 6
Posted: Wed, 2004-08-18 00:53

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.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2004-08-18 01:04

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?

 
wusun

Joined: 2004-08-10
Posts: 6
Posted: Wed, 2004-08-18 01:24

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

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2004-08-18 01:27

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.

 
wusun

Joined: 2004-08-10
Posts: 6
Posted: Wed, 2004-08-18 15:57

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