wiverson / maven-jpackage-template

Sample project illustrating building nice, small cross-platform JavaFX or Swing desktop apps with native installers while still using the standard Maven dependency system.
Apache License 2.0
346 stars 53 forks source link

Unable to start the software by double clicking the icon #25

Open renojjoseph opened 3 years ago

renojjoseph commented 3 years ago
  1. @wiverson I have downloaded the Source code(tar.gz) in my Ubuntu 20.04 machine with JDK 16 and Maven 3.8.1, and run mvn clean install and successfully generated the testapp_21.32.012058-1_amd64.deb. Installed it successfully. But while double clicking on the icon nothing happens. Hence I have downloaded the .deb file from github, installed and tried to run and again nothing happens. Then stripped out the maven-jpackage-template-1.0-SNAPSHOT.jar from .deb file and run in terminal and got stack traceno main manifest attribute, in maven-jpackage-template-1.0-SNAPSHOT.jar
  2. I have made a demo modular project (consisting a blank stage only) and run mvn clean install .Everything is OK and fine up to [INFO] --- jtoolprovider-plugin:1.0.34:java-tool (jlink) @ maven-jpackage-template --- in the run log. After that get the following error [ERROR] jlink failed with error code [1] [ERROR] --add-modules [ERROR] javafx-controls,javafx.fxml,java.logging [ERROR] --module-path [ERROR] /home/user/eclipse-workspace/Demo/linux-javafx/javafx-jmods-16/ [ERROR] --output [ERROR] /home/user/eclipse-workspace/Demo/target/jvm-image [ERROR] --strip-native-commands [ERROR] --no-header-files [ERROR] --strip-debug [ERROR] --no-man-pages [ERROR] --compress=2 [INFO] Error: Module javafx.fxml not found java.lang.module.FindException: Module javafx.fxml not found at java.base/java.lang.module.Resolver.findFail(Resolver.java:900) at java.base/java.lang.module.Resolver.resolve(Resolver.java:128) at java.base/java.lang.module.Configuration.resolve(Configuration.java:421) at java.base/java.lang.module.Configuration.resolve(Configuration.java:255) at jdk.jlink/jdk.tools.jlink.internal.Jlink$JlinkConfiguration.resolve(Jlink.java:217) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImageProvider(JlinkTask.java:489) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.createImage(JlinkTask.java:399) at jdk.jlink/jdk.tools.jlink.internal.JlinkTask.run(JlinkTask.java:271) at jdk.jlink/jdk.tools.jlink.internal.Main.run(Main.java:54) at jdk.jlink/jdk.tools.jlink.internal.Main$JlinkToolProvider.run(Main.java:65) at java.base/java.util.spi.ToolProvider.run(ToolProvider.java:138) at io.github.wiverson.RunTool.runTool(RunTool.java:109) at io.github.wiverson.ToolProviderAdapterHints.execute(ToolProviderAdapterHints.java:276) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.838 s [INFO] Finished at: 2021-08-12T21:47:05+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal io.github.wiverson:jtoolprovider-plugin:1.0.34:java-tool (jlink) on project Demo: jlink 1 -> [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

Please help me to make the installer successfully

wiverson commented 3 years ago

Try downloading a fresh copy of the template and comment out loading the "plugins" in BaseApplication.java as described on the README (I just updated).

wiverson commented 3 years ago

Oh, and also try running mvn javafx:run to see if you can get the app to launch at all.

renojjoseph commented 3 years ago

@wiverson downloaded fresh copy of template and failed to run with mvn javafx:run. But interesting thing is that I can run my demo modular project (consisting a blank stage only and the pom.xml copied from template) with mvn javafx:run, even though it gives error with goal mvn clean install as stated in my first comment.

renojjoseph commented 3 years ago

forgot to post the stack trace user@user-HP-ZBook-Firefly-15-G7-Mobile-Workstation:~/Downloads/maven-jpackage-template-Ubuntu-latest$ mvn javafx:run [INFO] Scanning for projects... [INFO] [INFO] ---------------< com.changenode:maven-jpackage-template >--------------- [INFO] Building maven-jpackage-template 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] >>> javafx-maven-plugin:0.0.5:run (default-cli) > process-classes @ maven-jpackage-template >>> [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ maven-jpackage-template --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] Copying 4 resources to /home/user/Downloads/maven-jpackage-template-Ubuntu-latest/target/packaging [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ maven-jpackage-template --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] <<< javafx-maven-plugin:0.0.5:run (default-cli) < process-classes @ maven-jpackage-template <<< [INFO] [INFO] [INFO] --- javafx-maven-plugin:0.0.5:run (default-cli) @ maven-jpackage-template ---

(java:10881): Gdk-WARNING **: 10:25:21.660: XSetErrorHandler() called with a GDK error trap pushed. Don't do that. [ERROR] Command execution failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166) at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:553) at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:420) at org.openjfx.JavaFXRunMojo.execute (JavaFXRunMojo.java:105) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:553) at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:420) at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:105) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.327 s [INFO] Finished at: 2021-08-14T10:25:22+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.5:run (default-cli) on project maven-jpackage-template: Error: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [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