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.
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.
Jars in the ant classpath are placed in the order you declare them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With