When I run an executable created with launch4j, I see the splash screen open and then nothing else. Running with --l4j-debug-all, I see "Exit code: 1" at the end of the log file, "Resource 101: An error occurred while starting the application." near the begining of the log file, and classpath information in the middle. How can I get more information on what the error was starting the application? The runnable jar starts fine. If I add some simple output as the first line of my main method, I seems launch4j isn't getting even that far.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Usually in such cases the application is started successfully by launch4j but crashes for example due to incorrect classpath. Can you post the log and your configuration? If it's a console application you should see the stack trace.
Grzegorz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the reply. You're right, the classpath was the issue.
I was using the com.akathist.maven.plugins.launch4j / launch4j-maven-plugin / 1.7.10 plugin. After looking through the classpath in the launch4j log, I added <preCp>${project.artifactId}-${project.version}.jar</preCp> to fix the issue. It looks like the preCp setting is specific to launch4j-maven-plugin, rather than launch4j itself. I'll take a look at that and see why this may have been an issue. The issue doesn't seem to surface until the classpath gets to a certain length.
Thanks for pointing me to dig into the classpath. That helped a ton.
From a different report: the classpath was limited to 8192 chars, maybe this somehow influenced the maven plugin. This was increased to 30KB (not yet released), but there is a workaround as well described here: help forum
Grzegorz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I run an executable created with launch4j, I see the splash screen open and then nothing else. Running with --l4j-debug-all, I see "Exit code: 1" at the end of the log file, "Resource 101: An error occurred while starting the application." near the begining of the log file, and classpath information in the middle. How can I get more information on what the error was starting the application? The runnable jar starts fine. If I add some simple output as the first line of my main method, I seems launch4j isn't getting even that far.
Usually in such cases the application is started successfully by launch4j but crashes for example due to incorrect classpath. Can you post the log and your configuration? If it's a console application you should see the stack trace.
Grzegorz
Thanks for the reply. You're right, the classpath was the issue.
I was using the com.akathist.maven.plugins.launch4j / launch4j-maven-plugin / 1.7.10 plugin. After looking through the classpath in the launch4j log, I added <preCp>${project.artifactId}-${project.version}.jar</preCp> to fix the issue. It looks like the preCp setting is specific to launch4j-maven-plugin, rather than launch4j itself. I'll take a look at that and see why this may have been an issue. The issue doesn't seem to surface until the classpath gets to a certain length.
Thanks for pointing me to dig into the classpath. That helped a ton.
Last edit: Brian Hnat 2016-05-31
From a different report: the classpath was limited to 8192 chars, maybe this somehow influenced the maven plugin. This was increased to 30KB (not yet released), but there is a workaround as well described here: help forum
Grzegorz