poidasmith/winrun4j

Exceeds maximum classpath length

Opened this issue · 2 comments

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?

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?

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.