For everyone who was as confused upon reading this statement as me: it's true. There is no JRE anymore. The JRE is practically a subset of the JDK and with jigsaw you are supposed to use the new Java linker (jlink) to bundle an application-specific runtime with your jar instead of relying on a complete runtime (JRE) being available in your target environment.
I initially thought "there is no JRE" was some part of the Oracle license change fearmongering '
I've migrated all my apps to Java 11, or at least, my ones that will be migrated to Java 11. It's quite... interesting, to say the least. It ranges from easy to very hard depending on what your app uses in terms of dependencies, etc.
For java 9 most likely all you have to do is add --add-module java.xml.bind when running the program if you use xml (or most json) parsing libraries. Otherwise you dont have to do anything.
For java 10+ you have to get replacement libraries for the crap (including xml binding) that has been removed from the jdk. Most likely you don't need any of these libraries, except maybe xml binding.
Well, you have to add a lot of modules if you're using JavaFX, like, 250 characters worth of modules... other than that, upgrading to Java 11 is mostly okay depending on what dependencies your app uses.
I gotta admit, the add-module shit isn't quite as nice as just java -jar app.jar.
I would advice to get "Java 9 Modularity" book. For me, it made a lot of things clear. They also have migration chapter, where they migrate Spring/Hibernate application. Also, a chapter on Maven.
Modules just seem like unnecessary hassle if you already partition your dependencies well, but I'm probably missing some useful use cases. I'm a solo developer, fwiw.
Not only that, you get startup time bonuses as well since there aren't as many internal classes to load. For example, your server probably doesn't need to bring in the swing modules.
Modules seem to be all the rage for enterprise container "app servers" and the like, but for the rest of us, modules are solving a problem that we simply don't have.
Unfortunately, a lot of third party libraries are still problematic to use in 9+, and the JVM unconditionally spits out warnings about them anyhow. So our users complain to us about problems (but not really) in code that we don't control.
It's often very easy to add a Automatic-Module-Name entry to the manifest file, and I have only had one maintainer that have been negative to it when I have opened bug in projects.
78
u/MasterLJ Mar 19 '19
...and here I am still Java 8ing =|