Many work environments continue to stay on JRE8 -- I'm a little confused on how to proceed with developing for the latest versions of Java. I compile JavaFX applications with Java SE 8 using NetBeans 9. Is there a way for me to start distributing via JDK 9, 10, and 11+ but still keep it compatible with all the JRE8 environments?
Or once I compile via JDK11, will it only be compatible when or if an environment upgrades their runtime? Or can I distribute a completely separate jar that runs without the need for a JRE and start today (even if they stay on JRE 8)?
There is a break between Java 8, and the modular Javas 9+. Though the module system has support for combined non-modular and modular code, JavaFX becomes OpenJFX, and I would not rely on there being one code base for long.
Also mind that modular means you can deliver your application with JRE parts as a small standalone executable.
So develop in Java 11+, possibly "convert" the sources to java 8 with a small tool written yourself. Restrict the usage of var
and other short-cuts. (Maybe develop in java 8 and convert to Java 9+?).