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, guys!) 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?
- Platform Modules
- Command Line
- Packaging As Modular JAR
- Share & Follow
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):
Copyright © 2015, Oracle and/or its affiliates. All rights reserved.
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.
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.
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.
“Yes” and “Not directly but other tools will be improved so that will be doable in the future”.
Long story short: “Versions are hard, we don’t want to replicate build tool functionality, so ‘No'”. For more, listen to Mark Reinhold’s full answer.
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.