概述
我已经安装了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)
最后
以上就是纯真向日葵为你收集整理的java10javafx_ubuntu 18.10-如何用java安装JavaFX的全部内容,希望文章能够帮你解决java10javafx_ubuntu 18.10-如何用java安装JavaFX所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复