4

I'm using openjdk-8

openjdk version "1.8.0_212"  
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

and i try to install javafx by:

sudo apt-get install openjfx

but it is not installing any of jfxrt.jar, jfxswt.jar etc. in any of openjdk folders and it should according to this post. What am I doing wrong?

Doragu
  • 41

2 Answers2

0

I think you've probably figured it out by now, but for anyone else that comes across this, this StackOverflow answer worked for me on Ubuntu 18.04 with openJDK. In case the answer is deleted for some reason, here are the commands he gave - he didn't give any explanation, unfortunately.

apt purge openjfx
apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2
apt-mark hold openjfx libopenjfx-jni libopenjfx-java
0

That may not be an ideal solution, but every time when working with JavaFX I use this list of commands:

export PATH_TO_FX=path/to/javafx-sdk-13/lib

to add path variable

javac --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX.java

to compile program

java --module-path $PATH_TO_FX --add-modules javafx.controls HelloFX

to run program. Thats simply from openjfx documentation.

Doragu
  • 41