0
java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~19.10-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

但是,openjfx 包:

sudo apt list openjfx
Listing... Gotowe
openjfx/eoan,now 11.0.2+1-1 amd64 [installed]
openjfx/eoan 11.0.2+1-1 i386

似乎是用 java 10 编译的,因为我无法运行任何 JavaFX 应用程序:

Error:(3, 26) java: cannot access javafx.application.Application
  bad class file: /usr/share/openjfx/lib/javafx.graphics.jar!/javafx/application/Application.class
    class file has wrong version 54.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

有任何模式使它工作吗?

4

1 回答 1

0

JavaFX/OpenJFX 最近不是 OpenJDK 的一部分,因此您要么单独安装它,要么使用带有预打包 OpenJFX 的 OpenJDK 构建。

于 2020-02-06T12:02:39.607 回答