OK, here's my problem. I wrote some code using Java 9 which compiles and runs perfectly when using JRE 10.0.2. This code has a GUI written in JavaFX that allows users to select directories to be watched using a variation of this code: https://docs.oracle.com/javase/tutorial/essential/io/notification.html .
I planned on using this code in a research project where I run this code on some other people's machines - who may or may not have admin privileges to install the JRE on their own. This means that I should use a supported version of the JRE so that IT doesn't give me grief - which basically means Java 8 or Java 11.
Problem: My code doesn't work with either version. This leaves me with the following scenarios: (1) refactoring my code to be compatible with Java 8 or (2) refactoring my code to be compatible with Java 11.
I have made a cursory attempt to switch my language from 9 to 8, but I am getting the following errors:
java: package javafx.animation does not exist
java: package javafx.application does not exist
java: package javafx.concurrent does not exist
java: package javafx.geometry does not exist
(+ a few more javafx packages)
Java: package com.sun.nio.file does not exist
I have tried searching via Google and Stack Overflow for the solution to this problem but I have not found anything.
I have also started to look into using Java 11, following this post: Intellij can't recognize javafx 11 with OpenJDK 11 and I have tried every possible solution in the thread, but I'm getting the following error message:
JavaFX runtime components are missing, and are required to run this application
How can I solve these issues?
Thanks!
Update: I downloaded JavaFX from https://openjfx.io/ and added that to my library, which solved the issue with all the JavaFX imports. The com.sun.nio.file package is being much more tricky to nail down.