Plugin Development: JavaFx missing . But work in sanbox

Answered

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] com.intellij.ide.plugins.cl.PluginClassLoader@1f9931a2
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:51)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 150 more

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

/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home

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.

 

2 comments
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. 

 

0
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 - https://www.jetbrains.com/help/idea/switching-boot-jdk.html - or unset JAVA_HOME (and JDK_HOME) env variables. Please find the full instructions here:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under

0

Please sign in to leave a comment.