It is to my understanding that Java JREs are backwards compatible, if you write a program in Java (JDK) 7, it will run with Java (JRE) 8.
I have a couple of programs I developed in Java 8, and have .jar and EXE files that I built when I finished them, and they always ran fine. However, after installing Java JDK 11 (11.0.2), these old .jar files break...
I understand that this class and some other javax classes have been removed from JDK 11, so from a development standpoint you couldn't use them anymore without a tool such as Maven. But I do not understand why installing JDK 11 has any effect on my old jars, as I didn't install a new JRE, and even if one came with it, it should be backwards compatible?
Too add to this, I use Apache NetBeans 10, it worked fine with Java 8, but after I installed JDK 11, NetBeans 10 still ran but its loading window was big and blurry, and the IDE's images are blurry, and all the text is bigger.
So why is installing JDK 11 having these negative effects on older programs?
Note - I have tried associating the jars/EXEs with javaw.exe from JRE version 8 (201), however, they all still have the same issues.
Java tries to be backward compatible but sometimes breaking changes are necessary to evolve the ecosystem. Until now breaking changes were shipped with major release e.g. Java 9, 10, 11. In your case you are most likely affected by Java 11's JEP 320: Remove the Java EE and CORBA Modules.
Remember that Java 8 was released in 2014. For 5 years Oracle and the Java community provided patches and security fixes for Java 8 but doing this forever is impossible.
The issue you are facing is likely not an incompatiblity w.r.t. the bytecode. It is just a missing class.
Java 11 dropped the support of some old technologies - for example Java Applets. If you run a Java 8 Applet in a Java 11 JDK / JRE you will get a ClassNotFound exception just because Java 11 does not provide the class / jar.
Similarly for JavaFX, which still exists, but is not longer part of the Java Distribution. You have to add it as a separate Jar.
I believe it would be possible to add these classes to a project. Personally I would like to see a port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With