Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant classpath Order

How do I set the classpath order in ant?

Specifically, When I am trying to run my ant build, I need it to pick up a class in a jar (jaxws-api.jar) instead of the same class which is in the jre. I am currently setting the classpath to explicitly include those jars however it seems to still pick up the jre first. What I am looking for is some type of equivalent to Order/Export in eclipse under the "Build Configuration" menu.

Edit: I'll be more explicit. I have some classes which were generated with CXF 2.1.3. They call javax.xml.ws.Service#getPort(QName, Class, WebServiceFeature...). I am using Java version 1.6.02. This method does not exist in that class in that version. However, it does exist in the jaxws version of the class (and later versions of the JRE class). When I try to do an ant build, the JRE class is always picked up first before the jaxws version. This makes my compilation fail. How can I modify my classpath to put the JRE last?

I can't change the JRE version, so please don't suggest that as a fix unless it is the only possible one.

like image 712
jconlin Avatar asked Jun 02 '09 14:06

jconlin


2 Answers

Looks like you need to use the bootclasspath setting in the Javac or Java Ant task.

You can always do ant -v to get verbose output of your Ant build.

like image 55
mtpettyp Avatar answered Sep 21 '22 23:09

mtpettyp


Jars in the ant classpath are placed in the order you declare them.

like image 36
Robert Munteanu Avatar answered Sep 20 '22 23:09

Robert Munteanu