orphan-oss/launch4j-maven-plugin

build failed, poor error description

marijusGood opened this issue · 2 comments

I was migrating our project from Java 11 to Java 17. In Java 11 I did not get any errors, while in Java 17 I got this error:
[ERROR] net.sf.launch4j.BuilderException: Enter: JRE path at net.sf.launch4j.Builder.build (Builder.java:76) at com.akathist.maven.plugins.launch4j.Launch4jMojo.doExecute (Launch4jMojo.java:478) at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute (Launch4jMojo.java:342) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283) at org.apache.maven.cli.MavenCli.main (MavenCli.java:206) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:06 min [INFO] Finished at: 2023-06-23T18:30:20+02:00 [INFO] ------------------------------------------------------------------------ [WARNING] [WARNING] Plugin validation issues were detected in 10 plugin(s) [WARNING] [WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.8.0 [WARNING] * org.apache.maven.plugins:maven-jar-plugin:3.1.1 [WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.1.0 [WARNING] * org.codehaus.mojo:build-helper-maven-plugin:3.2.0 [WARNING] * org.apache.maven.plugins:maven-antrun-plugin:3.0.0 [WARNING] * org.codehaus.izpack:izpack-maven-plugin:5.1.3 [WARNING] * org.apache.maven.plugins:maven-surefire-plugin:2.22.1 [WARNING] * org.apache.maven.plugins:maven-dependency-plugin:3.1.1 [WARNING] * pl.project13.maven:git-commit-id-plugin:2.2.5 [WARNING] * org.codehaus.mojo:exec-maven-plugin:3.0.0 [WARNING] [WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE] [WARNING] [ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:2.4.1:launch4j (l4j-create_installer_without_JRE) on project CryptoTool: Failed to build the executable; please verify your configuration.: Enter: JRE path -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I have java in my path:
echo $JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64

and all the libs are there.

here is the code that I ran:

XML <plugin> <groupId>com.akathist.maven.plugins.launch4j</groupId> <artifactId>launch4j-maven-plugin</artifactId> <version>2.4.1</version> <executions> <execution> <id>l4j-create_App_Exe</id> <phase>package</phase> <goals> <goal>launch4j</goal> </goals> <configuration> <chdir>.</chdir> <headerType>gui</headerType> <downloadUrl>https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html</downloadUrl> <jar>target/${project.build.finalName}.jar</jar> <outfile>${staging.dir}/${info.appName}.exe</outfile> <icon>${staging.dir}/images/256.ico</icon> <classPath> <mainClass>${mainClass}</mainClass> <jarLocation>lib</jarLocation> </classPath> <jre> <path>jre</path> <bundledJre64Bit>true</bundledJre64Bit> <bundledJreAsFallback>true</bundledJreAsFallback> <minVersion>11</minVersion> <jdkPreference>preferJdk</jdkPreference> <runtimeBits>64/32</runtimeBits> </jre> <versionInfo> <fileVersion>${info.exeVersion}</fileVersion> <txtFileVersion>${info.exeVersion}</txtFileVersion> <fileDescription>${project.name}</fileDescription> <copyright>C</copyright> <productVersion>${info.exeVersion}</productVersion> <txtProductVersion>${info.exeVersion}</txtProductVersion> <productName>${project.name}</productName> <internalName>${project.artifactId}</internalName> <originalFilename>${project.artifactId}.exe</originalFilename> </versionInfo> </configuration> </execution> <execution> <id>l4j-create_installer_without_JRE</id> <phase>install</phase> <goals> <goal>launch4j</goal> </goals> <configuration> <chdir>.</chdir> <headerType>gui</headerType> <downloadUrl>https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/downloads-list.html</downloadUrl> <jar>${install.dir}/${project.build.finalName}-${installer-output-filename}.jar</jar> <outfile>${project.build.directory}/installer/windows/${project.build.finalName}-${installer-output-filename}.exe</outfile> <icon>${staging.dir}/images/256.ico</icon> <classPath> <mainClass>com.izforge.izpack.installer.bootstrap.Installer</mainClass> <jarLocation>lib</jarLocation> </classPath> <jre> <bundledJre64Bit>false</bundledJre64Bit> <bundledJreAsFallback>false</bundledJreAsFallback> <minVersion>11</minVersion> <jdkPreference>preferJdk</jdkPreference> <runtimeBits>64/32</runtimeBits> </jre> <versionInfo> <fileVersion>${info.exeVersion}</fileVersion> <txtFileVersion>${info.exeVersion}</txtFileVersion> <fileDescription>${project.name}</fileDescription> <copyright>C</copyright> <productVersion>${info.exeVersion}</productVersion> <txtProductVersion>${info.exeVersion}</txtProductVersion> <productName>${project.name}</productName> <internalName>${project.artifactId}</internalName> <originalFilename>${project.artifactId}.exe</originalFilename> </versionInfo> </configuration> </execution> </executions> </plugin>

Did you try to specify <jre><path>JRE path (%VAR%)</path></jre>? as this is required right now, see the example - this is since Launch4j 3.50