运行 jdk1.8.0 的 ARM 上的 JavaFX [英] JavaFX on ARM running jdk1.8.0

查看:91
本文介绍了运行 jdk1.8.0 的 ARM 上的 JavaFX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 Oracle 在 8u33 中删除了 JavaFX,但我想知道为什么我不能将 JavaFX 与 jdk1.8.0 一起使用?我从 Oracle 档案 (http://download.oracle.com/otn/java/jdk/8-b132/jdk-8-linux-arm-vfp-hflt.tar.gz)

I know that Oracle removed JavaFX in 8u33, but I'm wondering why I can't use JavaFX with 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)

我在 /usr/bin/java_8_arm/jdk1.8.0 中提取了它,并且正在使用 sudo/usr/bin/java_8_arm/jdk1.8.0/bin/运行我的 .jar 文件java -jar jarfile.jar

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/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)

并运行 System.out.println("Running Java version:" + Runtime.class.getPackage().getImplementationVersion());

返回 Running Java Version: 1.8.0

我得到的错误是:

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

如果您想知道,我正在通过 Windows 7 编写程序并将其编译为共享文件,并从 Raspberry Pi 运行 JAR.

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.

inb4为什么你需要在树莓派上使用 javafx"——渲染 html,因为其他 java 组件只支持 html 3.2.我试过其他渲染器.这是唯一一个我什至可以在我的桌面上正常工作的,更不用说 RPi 了.

inb4 "why do you need javafx on a raspberry pi" - to render html, since other java components only support 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.

另外,我也在 1.8.0 上编程和编译.

Also, I am programming and compiling on 1.8.0 as well.

更新:

根据 José Pereda 的回答,我已经下载了 JavaFX 文件并将它们放置在我原来的 Java 安装中(我现在使用 /usr/bin/jdk8u6/ 作为我的文件夹,显然 jdk1.8.0_06).

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).

这是我的安装层次结构,从 lib 目录开始:

Here is my install hierarchy, starting from the lib directory:

/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.

推荐答案

您可以从这里下载 JavaFX for ARM 的更新和升级版本:JavaFX 嵌入式 SDK

You can download an updated and upgraded version of JavaFX for ARM from here: JavaFX Embedded SDK

在您的 Raspberry Pi 上下载后,您需要提取内容并将其复制到 JDK 1.8 中(检查此 链接 用于嵌入).

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).

您将能够在您的 Pi 上运行最新的 JavaFX 版本for ARM*,包括 WebView 控件.

You will be able to run the latest JavaFX version for ARM* on your Pi, including the WebView control.

此外,在您的 IDE 中使用 Gluon 插件,您将能够远程 你的树莓派上的项目也是如此.

Also, using the Gluon plugin for your IDE, you'll be able to deploy remotely the project on your Pi as well.

编辑

*ARM:请注意,JavaFX for ARM 从未支持 Swing.其他功能,如 WebView 和 Media 也不受支持,但最近这些功能已包含在 Gluon 的构建中.

*ARM: Note that JavaFX for ARM has never supported Swing. Other features like the WebView and Media weren't supported either, but recently these have been included in Gluon's build.

这篇关于运行 jdk1.8.0 的 ARM 上的 JavaFX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆