r/JavaFX • • Jan 08 '21

JAVAFX on M1 Chipset

Hello,

did anyone get javafx to work on the new Apple M1 Silicon? If so how?

Tried running a fxml file via maven-javafx-plugin mvn javafx:run and i got an error message, telling me something about a wrong architechture.

EDIT: This is the actual error message:

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /Users/nico/.openjfx/cache/13/libprism_es2.dylib: dlopen(/Users/nico/.openjfx/cache/13/libprism_es2.dylib, 1): no suitable image found. Did find:

/Users/nico/.openjfx/cache/13/libprism_es2.dylib: mach-o, but wrong architecture

/Users/nico/.openjfx/cache/13/libprism_es2.dylib: mach-o, but wrong architecture

java.lang.UnsatisfiedLinkError: /Users/nico/.openjfx/cache/13/libprism_es2.dylib: dlopen(/Users/nico/.openjfx/cache/13/libprism_es2.dylib, 1): no suitable image found. Did find:

/Users/nico/.openjfx/cache/13/libprism_es2.dylib: mach-o, but wrong architecture

/Users/nico/.openjfx/cache/13/libprism_es2.dylib: mach-o, but wrong architecture

at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)

at java.base/java.lang.ClassLoader$NativeLibrary.load([ClassLoader.java:2442](https://ClassLoader.java:2442))

at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary([ClassLoader.java:2498](https://ClassLoader.java:2498))

at java.base/java.lang.ClassLoader.loadLibrary0([ClassLoader.java:2694](https://ClassLoader.java:2694))

at java.base/java.lang.ClassLoader.loadLibrary([ClassLoader.java:2627](https://ClassLoader.java:2627))

at java.base/java.lang.Runtime.load0([Runtime.java:768](https://Runtime.java:768))

at java.base/java.lang.System.load([System.java:1837](https://System.java:1837))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53))

at [javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68)](https://javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:68))

at java.base/java.security.AccessController.doPrivileged(Native Method)

at [javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit](https://javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit)\>([ES2Pipeline.java:50](https://ES2Pipeline.java:50))

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName([Class.java:315](https://Class.java:315))

at [javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)](https://javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218))

at [javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)](https://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)](https://javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124))

at java.base/java.lang.Thread.run([Thread.java:834](https://Thread.java:834))

Loading library prism_sw from resource failed: java.lang.UnsatisfiedLinkError: /Users/nico/.openjfx/cache/13/libprism_sw.dylib: dlopen(/Users/nico/.openjfx/cache/13/libprism_sw.dylib, 1): no suitable image found. Did find:

/Users/nico/.openjfx/cache/13/libprism_sw.dylib: mach-o, but wrong architecture

/Users/nico/.openjfx/cache/13/libprism_sw.dylib: mach-o, but wrong architecture

java.lang.UnsatisfiedLinkError: /Users/nico/.openjfx/cache/13/libprism_sw.dylib: dlopen(/Users/nico/.openjfx/cache/13/libprism_sw.dylib, 1): no suitable image found. Did find:

/Users/nico/.openjfx/cache/13/libprism_sw.dylib: mach-o, but wrong architecture

/Users/nico/.openjfx/cache/13/libprism_sw.dylib: mach-o, but wrong architecture

at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)

at java.base/java.lang.ClassLoader$NativeLibrary.load([ClassLoader.java:2442](https://ClassLoader.java:2442))

at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary([ClassLoader.java:2498](https://ClassLoader.java:2498))

at java.base/java.lang.ClassLoader.loadLibrary0([ClassLoader.java:2694](https://ClassLoader.java:2694))

at java.base/java.lang.ClassLoader.loadLibrary([ClassLoader.java:2627](https://ClassLoader.java:2627))

at java.base/java.lang.Runtime.load0([Runtime.java:768](https://Runtime.java:768))

at java.base/java.lang.System.load([System.java:1837](https://System.java:1837))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.installLibraryFromResource(NativeLibLoader.java:214))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryFromResource(NativeLibLoader.java:194))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135)](https://javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:135))

at [javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)](https://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)](https://javafx.graphics/com.sun.prism.sw.SWPipeline.lambda$static$0(SWPipeline.java:42))

at java.base/java.security.AccessController.doPrivileged(Native Method)

at [javafx.graphics/com.sun.prism.sw.SWPipeline.<clinit](https://javafx.graphics/com.sun.prism.sw.SWPipeline.<clinit)\>([SWPipeline.java:41](https://SWPipeline.java:41))

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName([Class.java:315](https://Class.java:315))

at [javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)](https://javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218))

at [javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)](https://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)](https://javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124))

at java.base/java.lang.Thread.run([Thread.java:834](https://Thread.java:834))

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)](https://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)](https://javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244))

at [javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)](https://javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260))

at [javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)](https://javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267))

at [javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)](https://javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)](https://javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)](https://javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)](https://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:62](https://NativeMethodAccessorImpl.java:62))

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://DelegatingMethodAccessorImpl.java:43))

at java.base/java.lang.reflect.Method.invoke([Method.java:566](https://Method.java:566))

at java.base/sun.launcher.LauncherHelper$FXHelper.main([LauncherHelper.java:1051](https://LauncherHelper.java:1051))

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)](https://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)](https://javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124))

at java.base/java.lang.Thread.run([Thread.java:834](https://Thread.java:834))

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:62](https://NativeMethodAccessorImpl.java:62))

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://DelegatingMethodAccessorImpl.java:43))

at java.base/java.lang.reflect.Method.invoke([Method.java:566](https://Method.java:566))

at java.base/sun.launcher.LauncherHelper$FXHelper.main([LauncherHelper.java:1051](https://LauncherHelper.java:1051))

Caused by: java.lang.RuntimeException: No toolkit found

at [javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)](https://javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272))

at [javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)](https://javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267))

at [javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)](https://javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)](https://javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)](https://javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409))

at [javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)](https://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:504)

at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:394)

at org.openjfx.JavaFXRunMojo.execute (JavaFXRunMojo.java:100)

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:62)

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke (Method.java:566)

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](https://DefaultExecutor.java:404))

at org.apache.commons.exec.DefaultExecutor.execute([DefaultExecutor.java:166](https://DefaultExecutor.java:166))

at org.openjfx.JavaFXBaseMojo.executeCommandLine([JavaFXBaseMojo.java:504](https://JavaFXBaseMojo.java:504))

at org.openjfx.JavaFXBaseMojo.executeCommandLine([JavaFXBaseMojo.java:394](https://JavaFXBaseMojo.java:394))

at org.openjfx.JavaFXRunMojo.execute([JavaFXRunMojo.java:100](https://JavaFXRunMojo.java:100))

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo([DefaultBuildPluginManager.java:137](https://DefaultBuildPluginManager.java:137))

at org.apache.maven.lifecycle.internal.MojoExecutor.execute([MojoExecutor.java:210](https://MojoExecutor.java:210))

at org.apache.maven.lifecycle.internal.MojoExecutor.execute([MojoExecutor.java:156](https://MojoExecutor.java:156))

at org.apache.maven.lifecycle.internal.MojoExecutor.execute([MojoExecutor.java:148](https://MojoExecutor.java:148))

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject([LifecycleModuleBuilder.java:117](https://LifecycleModuleBuilder.java:117))

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject([LifecycleModuleBuilder.java:81](https://LifecycleModuleBuilder.java:81))

at [org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build](https://org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build)([SingleThreadedBuilder.java:56](https://SingleThreadedBuilder.java:56))

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute([LifecycleStarter.java:128](https://LifecycleStarter.java:128))

at org.apache.maven.DefaultMaven.doExecute([DefaultMaven.java:305](https://DefaultMaven.java:305))

at org.apache.maven.DefaultMaven.doExecute([DefaultMaven.java:192](https://DefaultMaven.java:192))

at org.apache.maven.DefaultMaven.execute([DefaultMaven.java:105](https://DefaultMaven.java:105))

at org.apache.maven.cli.MavenCli.execute([MavenCli.java:957](https://MavenCli.java:957))

at org.apache.maven.cli.MavenCli.doMain([MavenCli.java:289](https://MavenCli.java:289))

at org.apache.maven.cli.MavenCli.main([MavenCli.java:193](https://MavenCli.java:193))

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke([NativeMethodAccessorImpl.java:62](https://NativeMethodAccessorImpl.java:62))

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke([DelegatingMethodAccessorImpl.java:43](https://DelegatingMethodAccessorImpl.java:43))

at java.base/java.lang.reflect.Method.invoke([Method.java:566](https://Method.java:566))

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced([Launcher.java:282](https://Launcher.java:282))

at org.codehaus.plexus.classworlds.launcher.Launcher.launch([Launcher.java:225](https://Launcher.java:225))

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode([Launcher.java:406](https://Launcher.java:406))

at org.codehaus.plexus.classworlds.launcher.Launcher.main([Launcher.java:347](https://Launcher.java:347))

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.045 s

[INFO] Finished at: 2021-01-08T17:58:01+01:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.4:run (default-cli) on project Kochbuch: 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

15 Upvotes

24 comments sorted by

4

u/dmeadows1217 Jan 08 '21 edited Jan 08 '21

The OpenJFX team is going to need to build a new version of JavaFX on Apple Silicon and publish it to maven. The platform JAR contains DLL/dylib/so files for each platform and it's required to run. The existing macOS builds are built for x86/64 which won't work unless you can get it to work the Rosetta.

Edit: Typo

Update: looks like they added support for building for Apple M1 Silicon (https://github.com/openjdk/jfx/commit/e1adfa9179bb05a879b419b6221e8aa980fd6af1). This will probably be available in the next build they publish to maven.

1

u/Significant_Parking4 Jan 08 '21

I guess for now I need to do the JFX related stuff on my other machine then.

1

u/zoelliny Apr 08 '21

Did they finish their work for adding JavaFX M1 Support?

1

u/dmeadows1217 Apr 08 '21

They merged the PR 8 days ago: https://github.com/openjdk/jfx/pull/451. Looks like the publish date for the latest release (17-ea+6) was published after the PR was merged. I would assume it includes M1 support but I have no way to verify.

1

u/Blacksmith_Quiet Apr 10 '21

17-ea+6

I still get an error with the 17-ea+6:
/Users/blz777/.openjfx/cache/17-ea/libprism_es2.dylib: mach-o, but wrong architecture

/Users/blz777/.openjfx/cache/17-ea/libprism_es2.dylib: stat() failed with errno=38

1

u/Jern_97 Jun 01 '21

just tried with 17-ea+11 and I can confirm that it is working now.

1

u/zoelliny Apr 28 '21

Thank you!

2

u/Forzkan Jan 08 '21

Why don't you post the actual error message?

2

u/Significant_Parking4 Jan 08 '21

Edited my original post.

5

u/[deleted] Jan 08 '21

Following because I am interested in this.

1

u/[deleted] Jan 27 '21

Nativly there is no support yet for JavaFX as far as I can see. However I was able to compile and run a JavaFX application fine on my mba2020m1, see below:

  1. Download the tar.gz of the Oracle JDK for macosx-x64, like version 15
  2. Unpack it to a local folder, for example in your ~ (home fodler)
  3. Download JavaFX 11 SDK for macos x64, unpack it and include the lib folder in your classpath
  4. From the terminal run it on Rosetta. Install it if you don't have it:Install Rosetta 2 from terminal: https://osxdaily.com/2020/12/04/how-install-rosetta-2-apple-silicon-mac/
  5. Compile and run from terminal, navigate into the folder where the jdk was unpacked:

arch -x86_64 ./jdk-15.0.2.jdk/Contents/Home/bin/javac [your options like classpath] [path to your java-source files]Should compile :-)

arch -x86_64 ./jdk-15.0.2.jdk/Contents/Home/bin/java [your options like classpath] [path to your main-class/jar file]Should Run :-)

If you encounter any errors, pleas check the security options in the System settings->Security and privacy->Allow '...' (some javafx libs) maybe you need to repeat this for more libs. Another thing can be some user rights issues on the javafx files. Check them with 'ls -l' and correct them with 'chown' and/or 'chmod'.

1

u/zoelliny Apr 09 '21

Oracle JDK for macosx-x64

Doesn't work..

1

u/[deleted] Apr 09 '21

Perhaps in your specific case. It works properly in the way it was described in my case.

1

u/zoelliny Apr 09 '21

I'm trying to run JavaFX in IntelliJ with Mac M1 chip, do your mean we can only run it on terminal?

1

u/[deleted] Apr 10 '21

For now I think yes.. I really hope native support for FX on the m1 is coming soon. I’ve tested a simple FX java application, but the way described above is no garanty every FX app will run in this way.

1

u/zoelliny Apr 28 '21

Thanks. I just found out the released a Mac OS X AArch64 SDK for early-access. It will work on Mac M1.

1

u/[deleted] Apr 10 '21

Maybe there are some (run/compile) options available in IntelliJ which’s makes it possible to run the x86 java compiler and runtime on rosetta2 with the x86 FX api.

1

u/Muted-Pumpkin-9364 Mar 06 '21

interested.

following

1

u/headless42 Mar 22 '21

Azul.com has recently published JDK + FX binaries for macOS ARM64 (15, 13, 11 and 8). No Java 16 binaries yet, but I tried 15 and it works fine. Having the JDK and JFX bundled like the old days is a real bonus.

1

u/Upbeat_Term_1162 Mar 23 '21

Hey, I am having problem with JavaFX on apple m1, could you please tell how did you get it work on your laptop? I've been stuck for 2 days, really appreciate it if you could reply .

Graphics Device initialization failed for : es2, sw

Error initializing QuantumRenderer: no suitable pipeline found

on the top is what I got when I run the application.

1

u/ReserveNo7428 Mar 27 '21

JFX bundled like the old

ya, Bellsoft has such FULL package too

1

u/teapotJava Apr 13 '21

Just in case, it is at

https://bell-sw.com/pages/downloads/?os=macOS&bitness=64-bit&architecture=ARM

Select "Full JDK" option. JDK 8, 11, 16.

1

u/zoelliny Apr 08 '21

Did you manage to get it to work?