This directory contains examples using JavaFX
JavaFX is not available by default with all JVMs, and its absence can cause compilation issues. Consequently, all JavaFX examples are contained in this standalone directory, not part of the main examples.
If you are running on JDK 1.7 or inferior, the maven-enforcer plugin will require you to set the variable JAVAFX_HOME
before building.
That variable should point to a directory containing jfxrt.jar
, a file that is part of the JavaFX 2.0 distrbution.
Please set it to an instance of JavaFX that matches the JDK with which you are trying to use this project. Usually, the Sun JDK comes with JavaFX. However, OpenJDK does not and you may have to install OpenJFX, a free distribution of JavaFX.
Beware that your editor (e.g. IntelliJ) may not be using the JDK that is your system default (and that you may ancounter on the command line).
To run the JavaFX examples from IntelliJ, you'll have to add the jfxrt.jar
as an exernal dependency of your project. Here's a screencast on how to do it: https://youtu.be/si146q7WkSY
If you are using OpenJDK, on Ubuntu 16, you can install OpenJFX with sudo apt-get install openjfx libopenjfx-java
. A typical JAVAFX_HOME
is then /usr/share/java/openjfx/jre/lib/ext/
. If you are on Ubuntu 14, you can install OpenJFX with the following process:
/etc/apt/sources.list.d/openjdk-r-ppa-trusty.list
and uncomment the line for deb-srcsudo apt-get update
sudo apt-get install libicu-dev
sudo aptitude build-dep libopenjfx-java
sudo apt-get --compile source libopenjfx-java
ls -1 *.deb|xargs sudo dpkg -i
The Sun version of JDK8 still comes with its own JavaFX, so that there should be no need to configure anything particular there and the build will succeed. If using OpenJDK8, you will still have to install OpenJFX and set JAVAFX_HOME
, but the maven-enforcer plugin will not catch you — the reason being that it's difficult to distinguish between OpenJDK and Sun's JDK since version 8, with both adoptiong the same Vendor ID.
If you are using OpenJDK 8, install OpenJFX and set JAVAFX_HOME as indicated above. Compile with mvn clean install -POpenJFX
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。