[英]JavaFX on ARM running jdk1.8.0
I know that Oracle removed JavaFX in 8u33, but I'm wondering why I can't use JavaFX with jdk1.8.0? 我知道Oracle在8u33中删除了JavaFX,但我想知道为什么我不能将JavaFX与jdk1.8.0一起使用? I got it from the Oracle archives ( http://download.oracle.com/otn/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz )
我是从Oracle档案馆获得的( http://download.oracle.com/otn/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz )
I have this extracted in /usr/bin/java_8_arm/jdk1.8.0
and am running my .jar file with sudo /usr/bin/java_8_arm/jdk1.8.0/bin/java -jar jarfile.jar
我在
/usr/bin/java_8_arm/jdk1.8.0
压缩并使用sudo /usr/bin/java_8_arm/jdk1.8.0/bin/java -jar jarfile.jar
运行我的.jar文件sudo /usr/bin/java_8_arm/jdk1.8.0/bin/java -jar jarfile.jar
Running /usr/bin/java_8_arm/jdk1.8.0/bin/java -version
returns 运行
/usr/bin/java_8_arm/jdk1.8.0/bin/java -version
返回
java version "1.8.0"
Java (TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot (TM) client VM (build 25.0-b70, mixed mode)
and running System.out.println("Running Java version: " + Runtime.class.getPackage().getImplementationVersion());
并运行
System.out.println("Running Java version: " + Runtime.class.getPackage().getImplementationVersion());
returns Running Java Version: 1.8.0
返回
Running Java Version: 1.8.0
The error I'm getting is: 我得到的错误是:
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/embed/swing/JFXPanel
at front_end.GUI.initGUI(GUI.java:47)
at back_end.Run.main(Run.java:28)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.JFXPanel
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more
If you're wondering, I'm programming and compiling the program to a shared file via Windows 7 and running the JAR from a Raspberry Pi. 如果您想知道,我正在编程并通过Windows 7将程序编译为共享文件,并从Raspberry Pi运行JAR。
inb4 "why do you need javafx on a raspberry pi" - to render html, since other java components only support html 3.2. inb4“为什么你需要覆盆子pi上的javafx” - 渲染html,因为其他java组件只支持html 3.2。 I have tried other renderers.
我尝试过其他渲染器。 This is the only one I could even get working right on my desktop, let alone the RPi.
这是我唯一能在桌面上工作的,更不用说RPi。
Also, I am programming and compiling on 1.8.0 as well. 另外,我也在编程和编译1.8.0。
UPDATE: 更新:
As per José Pereda's answer, I have downloaded the JavaFX files and placed them in my original java install (I am now using /usr/bin/jdk8u6/
as my folder, and obviously jdk1.8.0_06
). 根据JoséPereda的回答,我已经下载了JavaFX文件并将它们放在我原来的java安装中(我现在使用
/usr/bin/jdk8u6/
作为我的文件夹,显然是jdk1.8.0_06
)。
Here is my install hierarchy, starting from the lib
directory: 这是我的安装层次结构,从
lib
目录开始:
/usr/bin/jdk8u6/lib/:
arm ext javafx.properties jfxswt.jar tools.jar
ct.sym ir.idl jconsole.jar orb.idl
dt.jar javafx.platform.properties jexec sa-jdi.jar
/usr/bin/jdk8u6/lib/arm:
jli libgstreamer-lite.so libjfxmedia.so
libdecora_sse.so libjavafx_font_freetype.so libjfxwebkit.so
libfxplugins.so libjavafx_font_pango.so libprism_common.so
libglass_monocle.so libjavafx_font.so libprism_es2_eglfb.so
libglass_monocle_x11.so libjavafx_iio.so libprism_es2_monocle.so
libglass.so libjawt.so libprism_sw.so
/usr/bin/jdk8u6/lib/arm/jli:
libjli.so
/usr/bin/jdk8u6/lib/ext:
jfxrt.jar
I still get the same error. 我仍然得到同样的错误。
You can download an updated and upgraded version of JavaFX for ARM from here: JavaFX Embedded SDK 您可以从此处下载JavaFX for ARM的更新和升级版本: JavaFX Embedded SDK
Once downloaded on your Raspberry Pi, you'll need to extract and copy the content into your JDK 1.8 (check this link for embedded). 在Raspberry Pi上下载后,您需要提取内容并将其复制到JDK 1.8中(请查看此链接以获取嵌入式内容)。
You will be able to run the latest JavaFX version for ARM* on your Pi, including the WebView control. 您将能够在Pi上运行ARM *的最新JavaFX版本,包括WebView控件。
Also, using the Gluon plugin for your IDE, you'll be able to deploy remotely the project on your Pi as well. 此外,使用您的IDE的Gluon插件,您也可以在Pi上远程部署项目。
EDIT 编辑
*ARM: Note that JavaFX for ARM has never supported Swing. * ARM:请注意,JavaFX for ARM从未支持Swing。 Other features like the WebView and Media weren't supported either, but recently these have been included in Gluon's build.
WebView和Media等其他功能也不受支持,但最近这些功能已包含在Gluon的版本中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.