This chapter covers:
- distinguishing standardized, supported, and internal JDK APIs
- finding dependencies on JDK-internal APIs with JDeps
- compiling and running code that depends on internal APIs
- why a split package can make classes invisible
- how to mend split packages
Chapter 6 discusses some problems that you might come up against when migrating your project to Java 9. Once you’re done with that, though, you are not going to encounter them ever again unless you pick up new dependencies that are outdated and not compatible with Java 9. This chapter explores two challenges where this is not true:
Navigation
- Relying on internal APIs leads to compile errors (7.1). This is true for JDK-internal APIs, for example classes from
sun.*
packages, but also for code internal to the libraries or frameworks you depend on.
- Splitting packages across artifacts causes compile and runtime errors (7.2). Again, this can happen between your code and JDK-modules as well as between any other two artifacts, for example your code and a third-party dependency.