为什么 Ubuntu Wily (15.10) 上的 OpenJDK 8 中不包含 JavaFX?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34243982/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?
提问by Nikola Stojakovi?
I've downloaded OpenJDK 8 today via sudo apt-get install openjdk-8-jdk
and it seems like JavaFX is not included in it.
我今天通过sudo apt-get install openjdk-8-jdk
它下载了 OpenJDK 8 ,它似乎不包含 JavaFX。
> java -version
openjdk version "1.8.0_66-internal"
OpenJDK Runtime Environment (build 1.8.0_66-internal-b17)
OpenJDK Server VM (build 25.66-b17, mixed mode)
I've installed E(fx)clipse in latest Eclipse (Eclipse Mars) too, but I'm still getting message javafx couldn't be resolved.
我也在最新的 Eclipse (Eclipse Mars) 中安装了 E(fx)clipse,但我仍然收到消息javafx can'tberesolution 。
回答by MWiesner
According to the packages listin Ubuntu WilyXenialBionic there is a package named openjfx. This should be a candidate for what you're looking for:
根据该软件包列表中的Ubuntu老谋深算Xenial仿生有一个名为包的OpenJFX。这应该是您正在寻找的候选人:
JavaFX/OpenJFX 8 - Rich client application platform for Java
JavaFX/OpenJFX 8 - Java 的富客户端应用程序平台
You can install it via:
您可以通过以下方式安装它:
sudo apt-get install openjfx
It provides the following JAR filesto the OpenJDK installation on Ubuntu systems:
它为Ubuntu 系统上的 OpenJDK 安装提供以下 JAR 文件:
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfxswt.jar
/usr/lib/jvm/java-8-openjdk-amd64/lib/ant-javafx.jar
/usr/lib/jvm/java-8-openjdk-amd64/lib/javafx-mx.jar
If you want to have sources available, for example for debugging, you can additionally install:
如果您希望有可用的源,例如用于调试,您可以另外安装:
sudo apt-get install openjfx-source
回答by Lo?ch
I use ubuntu 16.04 and because I already had openJDK installed, this command have solved the problem. Don't forget that JavaFX is part of OpenJDK.
我使用的是 ubuntu 16.04,因为我已经安装了 openJDK,这个命令已经解决了这个问题。不要忘记 JavaFX 是 OpenJDK 的一部分。
sudo apt-get install openjfx