EDIT: the tutorial linked in the answer of the duplicated question has gotten me past the problem I wrote about here. I had seen that question earlier and I did not, at the time, think it applied. But I was mistaken and I don't know how to account for the mistake. To install a working copy of a modular OpenJDK and JavaFX, I agree that the "Getting started" tutorial at http://openjfx.io is an appropriate resource. /EDIT
I have relatively simple source code that I would like to compile on Ubuntu. The code was developed in Eclipse/Windows, and makes use of JavaFX. My hope was to simply copy over the text source and do a modular compile, with the end goal being to make a self-contained program using jlink for Linux installation. The code is simple enough that the command line commands javac (with the modules option) and jlink are quite sufficient.
I installed OpenJDK 10, figuring that would be fine, as it contains the jlink utility and supports modular programming.
> java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
I'm able to run Java jars with it, but NOT if they require JavaFX.
> java -jar rnk.jar
Error: Could not find or load main class com.adonax.keyboard.LaunchKeyboard8
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
First attempt to deal with this, I installed OpenJFX with the following command:
sudo apt-get install OpenJFX
AFAIK, it installed fine, but I could not find instructions for testing or verifying the install on any of the Ask Ubuntu or StackOverflow posts that recommend this install. Attempting to run a jar which includes JavaFX code still fails, with the same error.
Using OpenJDK 8 is not a solution. The goal is to be able to use the command line javac and jlink, and Java 8 does not support modules.
I was trying to avoid using Oracle's Java 9 or 10, as suggested in many of the answers I've researched, because as far as I know, Oracle is requiring a license payment
I'm admittedly weak in terms of my Linux & Ubuntu knowledge, and have gotten myself totally confused on how to go forward. Ramping up to the expertise required to build as in this article would be a big leap.
I am hoping that these last few lines justifies my question not be marked a "duplicate question."
Is there something simpler that I've overlooked?