poidasmith / winrun4j

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

classpath limitation question #22

Closed kaserei closed 12 years ago

kaserei commented 12 years ago

I have recently ported a standalone command line Java tool to be run as a service with others but it has a very large classpath (130+ jars) . I am getting strange results that are likely the fault of the underlying platform and code I have not been able to fix yet, but I wanted to know if there is an upper limit on the size of the classpath that can be generated for a service wrapper, in it's ini file.

Note the existing command line version runs fine using a batch file to set and clear the classpath for the module.

I am using the ini file to specify a number of jars, plus one entry that references a folder containing the large jar collection. This results in the standard out showing all classes enumerated correctly (159 lines of "Expanding Classpath: ..." then a single line showing the generated classpath to be truncated at 3995 characters.

Is this a feature of the logging, or does it show a limitation in the maximum size of the generated classpath?

Thanks for any help.

poidasmith commented 12 years ago

Yes, the classpath is truncated when its logged. There should be no limit on the classpath length itself. You can always confirm this by dumping System.getProperty("java.class.path"). Cheers.

kaserei commented 12 years ago

Thanks, I was getting around to rebuilding the app with that property logged but I have to write test scripts all day long now, fun fun fun!

I have found that our underlying platform is causing the same fault in other areas too.