Solved

Eclipse & ANT Classpath

Posted on 2004-04-01
12
1,490 Views
Last Modified: 2013-11-23
I'm trying to use ANT to build my eclipse project and having problems which look like they're classpath related. I've set the classpath for the project and it appears to be fine when I'm editing it ( none of the import statements are errored and all the classes which are in the external jar files appear to be found. )

When I try to build it using ANT, I get a huge amount of errors which all indcate that it can't find the contents of the external jar files. I've added them in to the classpath for ANT ( Run / External Tools / External Tools ... ) in the Additional Classpath Entries bit and it hasn't made any difference.

Any clues?

Dave
0
Comment
Question by:howesd
  • 5
  • 3
  • 2
12 Comments
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10731462
In the Java Build Path of the project you have "Order and Export" Tab.

Check all those jars are checked.  That means they are available for runtime.  Otherwise, they will be used only for compile time.
0
 
LVL 1

Author Comment

by:howesd
ID: 10731491
They were all checked .......
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10731509
You are running the project by Run Ant Project button right?

What is the error?  Can you list out a few
0
 
LVL 1

Author Comment

by:howesd
ID: 10731564
I'm right clicking on my build.xml file and then doing "Run Ant ...."

These are the errors I'm getting:

Buildfile: C:\Program Files\eclipse\workspace\CVS_SPAR\SPAR\SPAR_build.xml

compile:
       [javac] Compiling 391 source files to H:\OOH\WEB-INF\classes
       [javac] C:\Program Files\eclipse\workspace\CVS_SPAR\SPAR\AccountViewElementBuilder.java:19: package org.jdom does not exist
       [javac] import org.jdom.*;
       [javac] ^
       [javac] C:\Program Files\eclipse\workspace\CVS_SPAR\SPAR\AccountViewElementBuilder.java:23: package org.apache.log4j does not exist
       [javac] import org.apache.log4j.Logger;
       [javac]                         ^
       [javac] C:\Program Files\eclipse\workspace\CVS_SPAR\SPAR\AccountViewElementBuilder.java:43: cannot resolve symbol
       [javac] symbol  : class Logger
       [javac] location: class SPAR.AccountViewElementBuilder
       [javac]    static Logger logger = Logger.getLogger(OrchidRouter.log4jLogger + ".AccountViewElementBuilder");
       [javac]           ^
       [javac] C:\Program Files\eclipse\workspace\CVS_SPAR\SPAR\UserIdRetriever.java:10: package org.jdom does not exist
       [javac] import org.jdom.*;
       [javac] ^
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10731576
keep the xerces and log4j jar in the classpath (of ANT while you run)
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Author Comment

by:howesd
ID: 10731633
I've stuck all the jars in to both the Ant classpath and the additional classpath items and it appears to have worked - what's the difference between the two?
0
 
LVL 9

Accepted Solution

by:
mmuruganandam earned 63 total points
ID: 10731654
Some how the classpath references are missing.  It is highly based on the eclipse workspace (how you have configured).

In reality, in the Ant classpath, only ant.jar and optional.jar is enough.
I sorry as it is environment specific, I wouldn't be able to give you a proper difference.


Regards,
Muruga
0
 
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 62 total points
ID: 10733747
You always need to specify JARs external to your JDK in the classpath provided to the Javac ANT task.

Good luck!
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10897309
No objections... please go ahead...
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10899652
Sounds good
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
advertisement module in core php 4 144
Spring Framework HTTPSession management 1 21
varialbe initialization 11 30
Way to decrease size of apk file 9 40
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now