When trying to compile an JavaFX application in the environment:
java -version
openjdk version \"1.8.0_212\"
OpenJDK Runtime Environment (build 1.8.0_212-8u2
The hint from
https://github.com/JabRef/help.jabref.org/issues/204
helped. The commands:
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
fixed the problem. Many thanks to https://github.com/Druidefix for this. (If you'd like to answer this yourself I'll happily delete my own answer ...)
What I did was build it from source. The instructions here on the OpenJDK wiki worked for me. Once I built it, I had to put the jars in the right place, like this other stackoverflow post talked about.
cd build/sdk/
sudo cp -R rt/lib /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/
sudo cp ./lib/ant-javafx.jar /usr/lib/jvm/java-8-openjdk-amd64/lib/
sudo cp ./lib/javafx-mx.jar /usr/lib/jvm/java-8-openjdk-amd64/lib/
After that I was able to compile my project!
For any learners looking for a bit of basic practice with javafx, installing Oracle's Java 8 (which has javafx built-in) might be a better solution then messing about with open packages. There are great instructions here
You can continue efforts getting openjfx installed, but this will keep your learning going.
This has already been suggested by aran in a comment to the OP, please consider upvoting that comment.