Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenJDK build Zulu-16.0.2 Native (Apple M1) Failure on App Launch #23

Closed
PerryCameron opened this issue Aug 7, 2021 · 10 comments
Closed

Comments

@PerryCameron
Copy link

Wonder project!

I tried it on my Windows 10 box and it worked great.

I tried it on my M1 Mac Mini and it compiled without errors. It created the macOS bundle. I opened the bundle and dragged the icon to the applications folder and that worked fine. When I tried to open the application it opened but the only thing that happened was the icon appeared on the doc. No window popped up as in windows. Below is the output from "mvn clean install"

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.changenode:maven-jpackage-template >---------------
[INFO] Building maven-jpackage-template 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ 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 /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/packaging
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ maven-jpackage-template ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ maven-jpackage-template ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ maven-jpackage-template ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ maven-jpackage-template ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ maven-jpackage-template ---
[INFO] Building jar: /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/maven-jpackage-template-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:copy-dependencies (copy-dependencies) @ maven-jpackage-template ---
[INFO] Copying javafaker-1.0.2.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/javafaker-1.0.2.jar
[INFO] Copying commons-lang3-3.5.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/commons-lang3-3.5.jar
[INFO] Copying snakeyaml-1.23-android.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/snakeyaml-1.23-android.jar
[INFO] Copying generex-1.0.2.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/generex-1.0.2.jar
[INFO] Copying automaton-1.11-8.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/automaton-1.11-8.jar
[INFO]
[INFO] --- jtoolprovider-plugin:1.0.34:java-tool (jlink) @ maven-jpackage-template ---
[INFO]
[INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ maven-jpackage-template ---
[INFO] Skipping artifact installation
[INFO]
[INFO] --- jtoolprovider-plugin:1.0.34:java-tool (jpackage) @ maven-jpackage-template ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.680 s
[INFO] Finished at: 2021-08-06T22:17:15-04:00
[INFO] ------------------------------------------------------------------------
parrishcameron@Parrishs-Mac-mini maven-jpackage-template-main % clear

parrishcameron@Parrishs-Mac-mini maven-jpackage-template-main % mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< com.changenode:maven-jpackage-template >---------------
[INFO] Building maven-jpackage-template 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ maven-jpackage-template ---
[INFO] Deleting /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target
[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 /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/packaging
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ maven-jpackage-template ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) @ maven-jpackage-template ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ maven-jpackage-template ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ maven-jpackage-template ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ maven-jpackage-template ---
[INFO] Building jar: /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/maven-jpackage-template-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:copy-dependencies (copy-dependencies) @ maven-jpackage-template ---
[INFO] Copying javafaker-1.0.2.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/javafaker-1.0.2.jar
[INFO] Copying commons-lang3-3.5.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/commons-lang3-3.5.jar
[INFO] Copying snakeyaml-1.23-android.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/snakeyaml-1.23-android.jar
[INFO] Copying generex-1.0.2.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/generex-1.0.2.jar
[INFO] Copying automaton-1.11-8.jar to /Users/parrishcameron/eclipse-workspace/maven-jpackage-template-main/target/dependency/automaton-1.11-8.jar
[INFO]
[INFO] --- jtoolprovider-plugin:1.0.34:java-tool (jlink) @ maven-jpackage-template ---
[INFO]
[INFO] --- maven-install-plugin:3.0.0-M1:install (default-install) @ maven-jpackage-template ---
[INFO] Skipping artifact installation
[INFO]
[INFO] --- jtoolprovider-plugin:1.0.34:java-tool (jpackage) @ maven-jpackage-template ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.684 s
[INFO] Finished at: 2021-08-06T22:24:42-04:00
[INFO] ------------------------------------------------------------------------

@PerryCameron
Copy link
Author

I forgot to mention I am using a 3rd party OpenJDK build Zulu-16.0.2 that is native to M1

@wiverson
Copy link
Owner

wiverson commented Aug 7, 2021

Check in your home directory - look for a .log file there (IIRC should be debugBUNCHOFNUMBERS.log or something like that). The generated app template dumps all log output there. My guess is that it's one of the "plugin" demos of extra desktop integration functionality throwing an exception and killing the main thread on launch.

There's another issue open for Ubuntu here, he was able to get it working by just commenting out the "plugins" stuff.

@wiverson
Copy link
Owner

wiverson commented Aug 7, 2021

At some point I should probably look at hardening the plugins stuff, IIRC some of them were causing native crashes :P and the regular exception handler was failing. That + some kind of integration test model for the generated apps.

@wiverson wiverson changed the title Apple M1 - sorta works OpenJDK build Zulu-16.0.2 Native (Apple M1) Failure on Launch Aug 7, 2021
@wiverson wiverson changed the title OpenJDK build Zulu-16.0.2 Native (Apple M1) Failure on Launch OpenJDK build Zulu-16.0.2 Native (Apple M1) Failure on App Launch Aug 7, 2021
@PerryCameron
Copy link
Author

No log

perrycameron@Perrys-Mac-mini ~ % ls -a | grep *.log
zsh: no matches found: *.log

@wiverson
Copy link
Owner

wiverson commented Aug 7, 2021

Hmm. Anything if you launch the app via mvn javafx:run ?

@PerryCameron
Copy link
Author

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: dlopen(/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib, 1): no suitable image found. Did find:
/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: mach-o, but wrong architecture
/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: stat() failed with errno=38
java.lang.UnsatisfiedLinkError: /Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: dlopen(/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib, 1): no suitable image found. Did find:
/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: mach-o, but wrong architecture
/Users/parrishcameron/.openjfx/cache/16/libprism_es2.dylib: stat() failed with errno=38
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)
at java.base/java.lang.Runtime.load0(Runtime.java:746)
at java.base/java.lang.System.load(System.java:1877)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
at javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:69)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at javafx.graphics/com.sun.prism.es2.ES2Pipeline.(ES2Pipeline.java:51)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:831)
Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: /Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: dlopen(/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib, 1): no suitable image found. Did find:
/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: mach-o, but wrong architecture
/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: mach-o, but wrong architecture
java.lang.UnsatisfiedLinkError: /Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: dlopen(/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib, 1): no suitable image found. Did find:
/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: mach-o, but wrong architecture
/Users/parrishcameron/.openjfx/cache/16/libprism_sw.dylib: mach-o, but wrong architecture
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)
at java.base/java.lang.Runtime.load0(Runtime.java:746)
at java.base/java.lang.System.load(System.java:1877)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135)
at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
at javafx.graphics/com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at javafx.graphics/com.sun.prism.sw.SWPipeline.(SWPipeline.java:41)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:831)
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:286)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:160)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.base/java.lang.Thread.run(Thread.java:831)
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: No toolkit found
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:273)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:286)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:160)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
... 5 more
[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: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: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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
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: 3.893 s
[INFO] Finished at: 2021-08-07T00:10:53-04:00
[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

@wiverson
Copy link
Owner

wiverson commented Aug 7, 2021

Ahh. Here's what I think is happening:
The M1-native JDK you are using is expecting to find M1-native JavaFX modules. It's not - it's finding the mac x64 instead, and when it launches it's getting confused and dying with what looks like a link error.

I think the way to fix it would be to either:

  • Use the macOS x64 native JDK instead with the macOS x64 native JavaFX jmods
  • Or, use macOS ARM/M1 native JDK with native macOS ARM/M1 native JavaFX jmods.

Gluon has posted macOS ARM/M1 native JavaFX mods as part of their Early Access builds for Java 17:
https://gluonhq.com/products/javafx/

Eventually this template will need to be updated to support both macOS Intel and macOS ARM/M1 builds. I don't have an M1 mac (yet, waiting for the 15" MBP M1X or whatever, ha). Also, I'm keeping this template in sync with the GA/"Latest Release" JavaFX for now.

So, congrats - you are in wild-and-wooly M1 build territory! In theory, you should be able to use an EA JDK 17 build along with the EA JavaFX M1 builds. I think you can just drop the M1 jmods into the mac JavaFX directory and it should work. Eventually I'll need to add a profile or options or something to the Maven build to account for the different OS + architectures - there are a lot of Java 17 JavaFX jmods. :P

I'm sure the folks working on M1-native JDK and JavaFX would love your feedback if you run into anything. I'm happy to help interpret any additional logs as they come up as well, but since I don't have an M1 machine I can't easily repro/debug.

@PerryCameron
Copy link
Author

PerryCameron commented Aug 7, 2021

So I decided to go with option #1
I used Liberica which contains FX

$ java --version
openjdk 16.0.2 2021-07-20
OpenJDK Runtime Environment (build 16.0.2+7)
OpenJDK 64-Bit Server VM (build 16.0.2+7, mixed mode)

I commented out:
javafx-controls
javafx-graphics
org.openjfx
javafx-maven-plugin

I changed this:
<jvm.modules>javafx.media,javafx.controls,javafx.fxml,java.logging</jvm.modules>

to this
<jvm.modules>java.logging</jvm.modules>

Inside the Jtool plugin I commented out this:
${project.basedir}/${platform}-javafx/javafx-jmods-${javafx.version}/

So it acts the same way it did before. mvn clean install shows no issues. but mvn javafx:run gives me this which I find strange because I commented out that module

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.789 s
[INFO] Finished at: 2021-08-07T12:08:11-04:00
[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]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.5:run (default-cli) on project maven-jpackage-template: Error

@PerryCameron
Copy link
Author

You know it would be neat if we could figure out how to make this work with every configuration, to make a spring app similar to start.spring.io, in which you would choose your options and it would spit out a project template exactly like you need.

@wiverson
Copy link
Owner

wiverson commented Aug 8, 2021

I think you still need to keep the module declaration in jvm.modules to keep JavaFX modules in the final image. Otherwise jlink won't include them when it builds the JVM.

Process exited with an error: 1 (Exit value: 1) isn't super helpful. When you launch a JavaFX app, it starts with just a dumb main method and then the main method fires up JavaFX. Might want to try seeing if you can get back to a working Hello World.

RE: dealing with every config & something like start.spring.io, yeah, would be cool. Probably would require Oracle and/or Gluon to put the $s into something like. Right now Gluon does have this https://start.gluon.io/ but it's only for certain JavaFX things. FWIW my project is open if they wanted to snag anything.

Repository owner locked and limited conversation to collaborators Sep 13, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants