Menu

--l4j-debug-all additional information

Help
Brian Hnat
2016-05-27
2016-06-20
  • Brian Hnat

    Brian Hnat - 2016-05-27

    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.

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2016-05-28

    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

     
  • Brian Hnat

    Brian Hnat - 2016-05-31

    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.

    <plugin>
        <groupId>com.akathist.maven.plugins.launch4j</groupId>
        <artifactId>launch4j-maven-plugin</artifactId>
        <version>1.7.10</version>
        <executions>
            <execution>
                <id>l4j-clui-gui</id>
                <phase>package</phase>
                <goals>
                    <goal>launch4j</goal>
                </goals>
                <configuration>
                <headerType>gui</headerType>
                <jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar>
                <stayAlive>true</stayAlive>
                <outfile>${project.build.directory}/cycle-${project.version}.exe</outfile>
                <downloadUrl>http://java.com/download</downloadUrl>
                <classPath>
                    <mainClass>com.tryonsolutions.gherkin.swing.jframe.cycle.Cycle</mainClass>
                    <preCp>${project.artifactId}-${project.version}.jar</preCp>
                </classPath>
                <icon>src/main/resources/icons/cycle-logo-final.ico</icon>
                <splash>
                    <file>src/main/resources/icons/splashscreen.bmp</file>
                    <waitForWindow>true</waitForWindow>
                    <timeout>1</timeout>
                </splash>
                <jre>
                    <minVersion>1.8.0</minVersion>
                    <jdkPreference>preferJre</jdkPreference>
                </jre>
                <versionInfo>
    
     

    Last edit: Brian Hnat 2016-05-31
  • Grzegorz Kowal

    Grzegorz Kowal - 2016-06-20

    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

     

Log in to post a comment.