Search code examples
javauser-interfacejavafxtermux

Openjdk-17.0.2 with javafx in termux


Hello I installed openjdk-17.0.2 In termux and I want to make a javafx application I start finding the sdk of javafx for java 17.0.2 but I got nothing. Can anybody tell how can I install the javafx for the openjdk 17.0.2. Or how can I install java 18.0.1 in termux because there is a option to download javafx sdk for java 18.0.1 but not for java 17.0.2.


Solution

  • For faster development and improvement, JavaFX was excluded from Java SE since OpenJDK 11, and now managed as a separate project (see https://github.com/openjdk/jfx). If you want to use JavaFX with Java SE, you need to download JavaFX jmods/SDK from https://www.gluonhq.com/products/javafx, and put them in module path / class path when building.

    However, the official builds of JavaFX can't be used in Termux because the architecture is incompatible. There is already a package request in Termux's official packages Github repository (see https://github.com/termux/termux-packages/issues/10225), if this package is built and added into Termux, then you can install it simply by apt install openjfx and use it in your build.