java10javafx_ubuntu 18.10-如何用java安装JavaFX

我已经安装了openjdk8和11。JavaFX也没有。

我安装了openjfx和libopenjfx java包,但无法使我的应用程序正常工作。

sudo apt list --installed| grep jfx

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libopenjfx-java/cosmic,cosmic,now 11+26-4 all [installed]

libopenjfx-jni/cosmic,now 11+26-4 amd64 [installed,automatic]

openjfx-source/cosmic,cosmic,now 11+26-4 all [installed]

openjfx/cosmic,now 11+26-4 amd64 [installed]

Openjfx解包到/usr文件夹

dpkg-query -L openjfx

/.

/usr

/usr/share

/usr/share/doc

/usr/share/doc/openjfx

/usr/share/doc/openjfx/TODO.Debian

/usr/share/doc/openjfx/changelog.Debian.gz

/usr/share/doc/openjfx/copyright

/usr/share/openjfx

/usr/share/openjfx/lib

/usr/share/openjfx/lib/javafx.properties

/usr/share/openjfx/lib/javafx.base.jar

/usr/share/openjfx/lib/javafx.controls.jar

/usr/share/openjfx/lib/javafx.fxml.jar

/usr/share/openjfx/lib/javafx.graphics.jar

/usr/share/openjfx/lib/javafx.media.jar

/usr/share/openjfx/lib/javafx.swing.jar

/usr/share/openjfx/lib/javafx.web.jar

我是否应该将库复制到java lib文件夹?否则,它不会编译不存在的错误。

javafx.*

包装

以前工作的jar现在退出:

Error: Could not find or load main class helloworld.HelloWorld

Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

编辑

多亏了@JosÃ

java --module-path /usr/share/openjfx/lib --add-modules=javafx.controls,javafx.fxml

现在扔

Caused by: java.lang.IllegalAccessError: class impl.org.controlsfx.version.VersionChecker (in unnamed module @0x28658d1c) cannot access class com.sun.javafx.runtime.VersionInfo (in module javafx.base) because module javafx.base does not export com.sun.javafx.runtime to unnamed module @0x28658d1c

at impl.org.controlsfx.version.VersionChecker.(VersionChecker.java:50)

at org.controlsfx.control.ControlsFXControl.(ControlsFXControl.java:35)

at org.controlsfx.control.CheckComboBox.(CheckComboBox.java:113)

at org.controlsfx.control.CheckComboBox.(CheckComboBox.java:104)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at java.base/java.lang.Class.newInstance(Class.java:584)

at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1019)

at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)

at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)

at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)

at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)

at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值