Beyond that I want to give the community a way to search and reference them, so I summarize them here:
- Prepare For JDK 9
- Introduction To Modular Development
- Advanced Modular Development
- Under the Hood Of Project Jigsaw
I made an effort to link to as many external resources as possible to keep the individual posts short. The play icons will take you straight to the corresponding point in the ten hour long video streams that Oracle put online for each room and day. (Great format, folks!) Not only did they (so far) fumble the cutting, they also seem to have resorted to low-volume mono sound so make sure to crank up the volume.
After preparing for JDK 9 let's continue with an introduction to modular development!
- Content: Introduction to the module system and the concept of modules
- Speaker: Alan Bateman
- Links: Video and Slides
▚What Is A Module?
Alan Bateman starts by explaining the basic concept of modules as named, self describing collections of code and data. This part is more than covered by The State Of The Module System (SOTMS):
Bateman also mentions
java -listmods, which will list all the available platform modules.
(Note that there are discussions on the mailing list to rename the flag.)
An option the guide does not mention is
java -Xdiag:resolver, which outputs additional information regarding module dependency resolution.
▚Packaging As Modular JAR
Modules can be packaged into so called modular JARs, which the quick-start guide covers as well.
Bateman stresses that such JARs work both on the module path in Java 9 as well as on the class path in Java 8 (as long as they target 1.8). He also quickly shows how the module path and class path can be mixed to launch a program.
Linking allows to bundle some modules and all of their transitive dependencies into a run-time image. If the initial modules are platform modules, the result will essentially be a variant of the JDK. This is in fact how the current Jigsaw builds are being created.
This is done with the new tool jlink and the quick-start guide shows how to do it.
There were a couple of interesting questions.
▚Is There Any Solution For Optional Dependencies?
In earlier Jigsaw prototypes there was a notion of optional dependencies. Working out the precise semantics turned out to be hard so the feature was not implemented. Research showed that optional dependencies can typically be refactored to services that might or might not be present at runtime.
Services are covered by the quick-start guide.
▚Can jlink Cross-Compile?
Can It Create A Self-Executing File?
▚Can Modules Be Versioned?
▚Can jlink Use Cross-Module Optimizations?
▚How Does JavaDoc Handle Modules?
JavaDoc will be upgraded so that it understands what modules are. It will display them along with packages and classes. And it will also by default not generate documentation for types in not-exported packages.