简体   繁体   English

运行jdk1.8.0的ARM上的JavaFX

[英]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.

相关问题 尽管有jdk1.8.0,Android Studio仍无法正常工作 - Android studio not working ins spite of having jdk1.8.0 扩展的 server_name(SNI 扩展)不与 jdk1.8.0 一起发送,但与 jdk1.7.0 一起发送 - Extended server_name (SNI Extension) not sent with jdk1.8.0 but send with jdk1.7.0 为什么要使用 jdk1.8.0 而不是 jdk-17? - Why should I use jdk1.8.0 instead of jdk-17? Selenium WebDriver / NetBeans 8.1 / JDK1.8.0异常ChromeDriver Runtime.executionContextCreated具有无效的“上下文” - Selenium WebDriver / NetBeans 8.1 / JDK1.8.0 Exception ChromeDriver Runtime.executionContextCreated has invalid 'context' " NoSuchMethodException:对于 jdk1.8.0 中的 sun.misc.Launcher$AppClassLoader.addAppURL(java.net.URL) - NoSuchMethodException: for sun.misc.Launcher$AppClassLoader.addAppURL(java.net.URL) in jdk1.8.0 Raspberry Pi + JDK1.8.0_151 + JavaFX + BlueJ - Raspberry Pi + JDK1.8.0_151 + JavaFX + BlueJ com.android.build.api.transform.TransformException'命令'C:\\ Program Files \\ Java \\ jdk1.8.0 \\ bin \\ java.exe''以非零退出值3结束 - com.android.build.api.transform.TransformException 'command 'C:\Program Files\Java\jdk1.8.0\bin\java.exe'' finished with non-zero exit value 3 JDK 11和JavaFX 11:ARM(Tinker Board)的构建未运行(哈希不匹配) - JDK 11 and JavaFX 11: build for ARM (Tinker Board) not running (hash mismatch) 为ARM运行JavaFX应用程序 - Running JavaFX application for ARM 使用 JDK 11+ 运行 JavaFX 应用程序 - Running JavaFX application with JDK 11+
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM