- Install your OS of choice (Preferably Debian based)
- Update the system
- Run:
sudo apt-get install openjdk-12-jdk
- Run:
sudo snap install eclipse --classic
- Download OpenJFX 12
- Extract the .zip and place the contents in a folder called .javafx in your home folder.
- Open eclipse
- Select:
Eclipse -> Window -> Preferences -> Java -> Build Path -> User Libraries -> New
- Name it JavaFX12
- Click ‘Add External JARs…”
- Go to /home/.javafx/lib
- Select OK
- Select ‘Apply and Close’
- Select:
Eclipse -> Help -> Eclipse Marketplace
- In the find field search for ‘FX’ (press enter)
- Install a version greater than or equal to ‘e(fx)clispe 3.5.0’
- Accept License agreement and Certificates then restart.
Well done you can now create Java and JavaFX applications in Linux.
A: Yes, it should as long as you replace the ‘apt install’ with your system counterpart.
Error: JavaFX runtime components are missing, and are required to run this application.
A: Follow these steps:
- Select: Eclipse -> Run -> Run Configurations
- Under ‘Java Application’ select your created program
- Under the arguments tab insert the following command into ‘VM arguments’ as one line:
-module-path /home/YOUR_USERNAME/.javafx/lib -add-modules javafx.controls,javafx.graphics,javafx.fxml
- Select ‘Apply’
A: No, a lot of this is specific to Eclipse if you want a good guide follow the OpenJFX documentation: https://openjfx.io/openjfx-docs/#introduction
A: I would like to as I find them easy to follow as well, but I can’t be bothered.
A: Just make a Pull Request and I'll probably merge it.
A: That’s not a question, and I don’t care reset your machine and try again.
A: Yes, yes I did. Though I did it because I / the people I wrote this for found it easier to follow. (P.S. Please go check these guys out they’ve done tones for the FX community)