Android Studio doesn't have JavaFX?

Does Android Studio's default JDK include JavaFX?


In other post(the below URL), AS3.0 should include the new runtime with JavaFX, but my plugin has error on AS 3.2 now.


The Error message is this.

java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel


If Android Studio's default JDK doesn't include JavaFX, I may have to include it to my plugin...



My plugin uses JavaFX and runs on AS 3.0 and AS 3.2 without issues. Your issue is probably with the JRE which is used to run AS. Check which JRE it is running on and see if jfxrt.jar is found in Contents/Home/jre/lib/ext of the JRE installation directory.


Vladimir Scheneider


Thank you for your reply.


But AS3.2(for MAC)'s default JRE is inside AS.



This is default setting and recommended setting.


And there is no jfxrt.jar in this path.

➜  ext pwd
➜ ext ls
cldrdata.jar localedata.jar sunec.jar zipfs.jar
dnsns.jar meta-index sunjce_provider.jar
jaccess.jar nashorn.jar sunpkcs11.jar


So, I think if your plugin can use on AS, it may be because you use not Mac AS? or you changed settings of AS, or only AS3.2 for Mac doesn't have JavaFX?


I'm using JavaFX in my plugin so I need to fix this problem...



My bad. You are right, I am running on a JRE with JavaFX not the bundled JRE. I changed the boot JDK a while back and forgot about it.

The bundled JRE does not have JavaFX libraries.

I use a hybrid JRE. A combination of the bundled JRE with missing files filled in from Oracle JRE. That way I can have the improved font rendering and bug fixes of the bundled JRE but with JavaFX. An old blog about doing it should still be valid.

However, the plugin will only work for those that change the boot JRE for AS.


I'm running AS on Mac with the following configurations:

Android Studio 3.5.3
Build #AI-191.8026.42.35.6010548, built on November 15, 2019
JRE: 1.8.0_202-release-1483-b49-5587405 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.1

and my JAVA_HOME is:


where jfxrt.jar exists:


and when I want to use an IDE plug-in that requires JavaFX, it tells me it couldn't instantiate and I should launch AS with JavaFX bundled

Any idea why?


Android Studio is using:

JRE: 1.8.0_202-release-1483-b49-5587405 x86_64

Not your JAVA_HOME JRE. Also JDK 1.8.0_40 support for JavaFX is really flaky with lots of bugs and JVM crashes. I would not use it today. The easiest way is probably to switch to a JetBrains JRE with JavaFX. You can download them from I usually get the JDK instead of the JRE and prefer to use the same version as the bundled JRE.

Expand the download to /Library/Java/JavaVirtualMachines subdirectory and then set the IDE JRE to it. The IDE will use it and you will have JavaFX.


Thanks for your help Vladimir ;)


Please sign in to leave a comment.