Plugin Development: JavaFx missing . But work in sanbox


I've tried to use JavaFx for Plugin Development for Android Studio. The version is: 

Android Studio 3.5
Build #AI-191.8026.42.35.5791312, built on August 9, 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.14.6

however , it work when runide in Sanbox. when I buildPlugin and install it  in the real environment, it told me that:

Caused by: java.lang.ClassNotFoundException: javafx.scene.web.WebView PluginClassLoader[tv.athena.controller, 0.2.84]
at java.lang.ClassLoader.loadClass(
... 150 more

Both in Sanbox and real Environment, I run the same version of Android studio. And, set the same bundled JDK:


I google it,  some posts said that the bundled jdk no longer include javafx jar at all. But Why it work when run in sanbox?

Of course , I want it work in Plugin development.


Comment actions Permalink

I found that it use jdk8 , even though I set the project jdk version to bundled jdk from the Project Structure. From the log file of idea.log:

2019-09-11 15:20:59,524 [ain Thread]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2019-09-11 15:20:59,560 [.0_171-b11] INFO - #com.intellij.idea.Main - IDE: Android Studio (build #AI-191.8026.42.35.5791312, 09 Aug 2019 08:02)
2019-09-11 15:20:59,560 [.0_171-b11] INFO - #com.intellij.idea.Main - OS: Mac OS X (10.14.6, x86_64)
2019-09-11 15:20:59,560 [.0_171-b11] INFO - #com.intellij.idea.Main - JRE: 1.8.0_171-b11 (Oracle Corporation)
2019-09-11 15:20:59,560 [.0_171-b11] INFO - #com.intellij.idea.Main - JVM: 25.171-b11 (Java HotSpot(TM) 64-Bit Server VM)
2019-09-11 15:20:59,561 [.0_171-b11] INFO - #com.intellij.idea.Main - JVM Args: -Dapple.awt.fileDialogForDirectories=true -Dapple.laf.useScreenMenuBar=true -Didea.classpath.index.enabled=false -Didea.config.path
2019-09-11 15:20:59,561 [.0_171-b11] INFO - #com.intellij.idea.Main - ext: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre/lib/ext: [sunec.jar, nashorn.jar, cldrdata.jar, jfxrt.jar, dnsns.jar, localedata.jar, sunjce_provider.jar, meta-index, sunpkcs11.jar, jaccess.jar, zipfs.jar]
2019-09-11 15:20:59,561 [.0_171-b11] INFO - #com.intellij.idea.Main - ext: /System/Library/Java/Extensions: [MRJToolkit.jar]
2019-09-11 15:20:59,562 [.0_171-b11] INFO - #com.intellij.idea.Main - charsets: JNU=UTF-8 file=UTF-8
2019-09-11 15:20:59,582 [.0_171-b11] INFO - #com.intellij.idea.Main - JNA library (64-bit) loaded in 20 ms
2019-09-11 15:20:59,609 [.0_171-b11] INFO - #com.intellij.idea.Main - initializing environment

This is marvelous. 


Comment actions Permalink

You run IDE with Oracle JRE. This is anyway is not encouraged. Please switch to the bundled JetBrains JRE (it does ship JavaFX). You should either use the switcher - - or unset JAVA_HOME (and JDK_HOME) env variables. Please find the full instructions here:


Please sign in to leave a comment.