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] 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.
请先登录再写评论。
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:
This is marvelous.
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