poidasmith / winrun4j

WinRun4J Java Application Launcher
http://winrun4j.sourceforge.net
212 stars 63 forks source link

Exceeds maximum classpath length #59

Open BigAl42 opened 10 years ago

BigAl42 commented 10 years ago

My app includes a folder with 317 jar files which are added from a subfolder with the * pattern. The new behavior is that my app does not start. Caused by several "class not found" exceptions. Starting the app manually with java.exe and the classpath reference to the lib/* causes no problem and the app starts as expected.

Is there an issue with the extended files and foldernames and the command shell input length?

neandrake commented 10 years ago

For our purposes we recently found some undesired behavior with the classpath glob expansion code in WinRun4J which can cause some issues (though we did not experience the same issue you describe).

Can you list what your classpath patterns are?

poidasmith commented 10 years ago

Right, so the reason will be that there is an upper limit to the classpath variable that is set. One workaround you can use is to set the working directory to be the module directory. This should avoid full path expansion (i.e. so you get lib/mylib1.jar;lib/mylib2.jar;...)

Edit: will also add an INI option to disable the classpath glob expansion and let the classloader do it instead.