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
Comments
I forgot to mention I am using a 3rd party OpenJDK build Zulu-16.0.2 that is native to M1 |
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. |
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. |
No log perrycameron@Perrys-Mac-mini ~ % ls -a | grep *.log |
Hmm. Anything if you launch the app via |
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: |
Ahh. Here's what I think is happening: I think the way to fix it would be to either:
Gluon has posted macOS ARM/M1 native JavaFX mods as part of their Early Access builds for Java 17: 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. |
So I decided to go with option #1 $ java --version I commented out: I changed this: to this Inside the Jtool plugin I commented out this: 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] ------------------------------------------------------------------------ |
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. |
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. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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] ------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered: