我该如何解决JavaFX运行时组件丢失的问题? [英] How do I fix JavaFX runtime components are missing?

查看:545
本文介绍了我该如何解决JavaFX运行时组件丢失的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu 18.04.1 LTS上安装了以下软件:

I have the following installed on Ubuntu 18.04.1 LTS:

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)

javafx.runtime.version=8.0.161
javafx.runtime.build=b00

但是,我尝试运行使用javafx的示例Java应用程序时,出现以下错误:

However I try to run the sample java application that uses javafx I get the following error:

$ java -jar Untitled.jar 
Error: JavaFX runtime components are missing, and are required to run this application

我试图在Eclipse,Intelli和终端中以相同的错误运行它.

I have tried to run it in Eclipse, Intelli, and in the terminal with the same error.

我已经设置了类路径

:~$ echo $CLASSPATH
/usr/share/java/openjfx/jre/lib/ext/jfxrt.jar:.

我已将所有javafx文件复制到当前目录. 我已经尝试了所有可以在互联网上找到的东西.

I have copied all of the javafx files to the current directory. I have tried everything I can find on the internet.

有人知道如何解决此问题吗?

Does anyone know how to fix this?

推荐答案

在安装了openjdk-11-jreopenjfx的Ubuntu 18.04上,您可以使用:

On Ubuntu 18.04 with openjdk-11-jre and openjfx installed you could use:

% java --module-path /usr/share/openjfx/lib --add-modules ALL-MODULE-PATH \
    -jar Untitled.jar

有关如何运行JavaFX程序的更多信息,请在 openjfx.io 网站.

There is more information on how to run JavaFX programs at the openjfx.io site.

这篇关于我该如何解决JavaFX运行时组件丢失的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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