Loader Constraints Violated when run program under Ant

J

Jim Cobban

When I run my java class from the command line it works fine, but if I try
to run it from within Ant I get the following errors:

run:
[java] Unable to set system look and feel
[java] java.lang.LinkageError: loader constraints violated when linking
org
/w3c/dom/Document class

I run it from the command line using the command:

javaw -classpath classes;
D:\j2sdk1.4.2_02\lib;
lib\jakarta-poi-1.5.1-final-20020615.jar;
lib\mm.mysql-2.0.11-bin.jar;
lib\xercesImpl.jar;
lib\xmlParserAPIs.jar Census.CensusUtility

[Where I have inserted new lines after the semi-colons for readability.]

My Ant target looks to me to have the same meaning as the command line, but
generates the error:

<target name="run" depends="compile" description="run a test" >
<java classname="Census.CensusUtility">
<classpath>
<pathelement location="classes/"/>
<pathelement location="lib/jakarta-poi-1.5.1-final-20020615.jar"/>
<pathelement location="lib/mm.mysql-2.0.11-bin.jar"/>
<pathelement location="lib/xercesImpl.jar"/>
<pathelement location="lib/xmlParserAPIs.jar"/>
</classpath>
</java>
</target>


--
Jim Cobban (e-mail address removed)
34 Palomino Dr.
Kanata, ON, CANADA
K2M 1M1
+1-613-592-9438
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top