poidasmith / winrun4j

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

Service with embedded JAR does not work (classpath problem?) #63

Open FernsPaanakker opened 10 years ago

FernsPaanakker commented 10 years ago

When I create a service with embedded JARs (I add the JAR and INI file to the EXE using RCEDIT) there seems to be a problem with the expansion of the classpath.

When I use "rcedit /L" I see a list of the JAR files I need. However, when I start the exe it lists:

[info] Found VM: C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll [info] Expanding Classpath: MapService.jar [info] Expanding Classpath: WinRun4J.jar [info] Generated Classpath:

So I guess something goes wrong with the classpath generation. When I copy the MapService.jar and WinRun4J.jar in the same directory it works:

[info] Found VM: C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll [info] Expanding Classpath: MapService.jar [info] Expanding Classpath: WinRun4J.jar [info] Generated Classpath: C:\temp\service\MapService.jar;C:\temp\service\WinRu n4J.jar

It is easy to reproduce: the service example has this problem as well. I'm not sure what I am doing wrong. Maybe I added the jar resource incorrectly? (rcedit /J mapservice.exe mapservice.jar) I do not want to distribute all the JARs with my service...embedding them is wonderful because it allows me to have only a single executable.

From what I see in the ClassPath.cpp sourcecode it looks like the classpath generation only uses jar that can be found in the file system. Can somebody point me to the relevant code where the embedded jar magic happens?

Maybe a related problem: rcedit /E does not extract the individual jars.

bdw429s commented 5 years ago

@FernsPaanakker Did you find a solution to this or get a reply from @poidasmith ? I think this is related to this bug which has become a complete show stopper for me. https://github.com/poidasmith/winrun4j/issues/90