how to add javafx dependencies in maven with java 10

血红的双手。 提交于 2019-12-06 07:23:46

OpenJDK never contained JavaFX and from Java 11 on, neither will Oracle JDK, so JavaFX will have to become a regular dependency. OpenJFX, the project behind JavaFX, has recently released an early access build of a standalone JavaFX SDK that works with Java 10 and 11, but it is not yet available on Maven Central (that is planned for the future).

For now, you have to download the SDK manually and find a way to add it to your Maven build, for example by deploying it to your Nexus or including it in a folder in your repo. Once it is available on Maven Central you will be able to use it just like any other dependency.

ok so actually the issue is kinda complex.

The OPENJDK version installed with ubuntu is a mix between java 10 and java 11 : the package installed is actually "openjdk-11" but the VM installed refers to itself as openjdk-10 . Just as openjdk-11 it does not provide the javafx modules.

The solution was to install the oracle jdk 10:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt install oracle-java10-installer

And then the minimum program I gave works.

Also I purged everything eg sudo apt remove --purge "openjdk-11*"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!