This chapter covers:
- why JEE modules are deprecated and not resolved by default
- compiling and running code that depends on JEE modules
- why casts to
URLClassLoader
fail
- the new JDK runtime image layout
- replacing the removed extension mechanism, endorsed standards override mechanism, and boot class path option
- handling all the smaller changes, like the new format of the Java version string
In this chapter and in chapter 7, I discuss the compatibility challenges when migrating an existing code base to Java 9 and beyond. We won’t be creating any modules yet, it’s just about building and running your existing project on the newest release.
Why would moving to Java 9 require two entire chapters, though; can’t you simply install the newest JDK and expect everything to just work? Isn’t Java meant to be backwards compatible? Yes, and it is if your project, including its dependencies, only relies on non-deprecated, standardized, and documented behavior. But that’s a big if and it turns out that in the absence of any enforcement the wider Java community has strayed from that path.