When deploying my application on a Hudson Server (windows machine) , I’m having problems calling java.exe because my class-path is too long — Windows taps out after certain length.
The classpath is basically hundreds of Jar files separated by semicolons
Assume the following classpath would be too large if each jar is explicitly listed in the classpath:
<path id="classpath.project">
<fileset dir="lib" includes="**/*.jar" />
</path>
What can I do in ant to shorten my classpath?
You can google for OneJar.
If you want to do it yourself, then generate an “empty” jar file that only has a manifest. Add a “Class-Path: a.jar, another.jar, bla-blub.jar” line containing all needed jars to the manifest. (Google for “manifest Class-Path”) (can be done with ant)
Provided that all jars are deployed aas usually you now only need your “empty” jar file on the classpath, as the JVM will now use the manifest to find all other jars.