When Jigsaw was released with Java 9, it was the end of a long process - it had been postponed already - and it had to be released. With the coming of Java 11, the latest Long-Term Support, I think it’s a good time to take a snapshot of the state of modularization.
I’ll use the Top 20 Libraries and APIs Java Developer should know as a reference, and check for each of them if the latest version:
- provides an automatic module name
- or has a
module-info
In the first case, the JAR has a stable module name. It’s still an automatic module, but it’s the first step into the module system. In the second case, the JAR is a full-fledged module as it has completely embraced the module system.
Name | Analyzed version | Module name | Modularized? |
---|---|---|---|
1.8.0-beta2 |
| ||
2.9.8 |
| ||
2.8.5 | |||
5.3.2 |
| ||
2.23.4 |
| ||
2.0.0-RC.4 | |||
3.8.1 |
| ||
3.6.1 | |||
27.0.1 |
| ||
4.5.6 |
| ||
2.12.0 | |||
1.4.11.1 | |||
2.1.1 | |||
JAXB | 2.3.1 |
| |
4.0.1 | |||
2.6.0 | |||
2.1.1 |
| ||
3.2.0 |
| ||
2.5.0 | |||
5.5.13 | |||
2.3 | |||
4.2 |
| ||
9.2.0 |
| ||
3.1.0 | |||
1.5 | |||
1.11.3 |
| ||
1.11 |
| ||
3.8.1 | |||
3.8.1 |
Only two of the libraries above are actually modularized! That is understandable, since implementing modules in one’s own library is a non-trivial effort. However, a lot of libraries - about 50% - don’t have an Automatic-Module-Name
, even though:
- It costs virtually nothing
- The latest version has been published in 2018 - Java 9 has been released in September 2017
Because of that, it makes it very hard for client applications/frameworks/libraries e.g. Spring to be modularized themselves. That makes me wonder what the future looks like for modules.
Interestingly enough, despite the lack of module support, a lot of the above libraries are OSGI bundles (e.g. ProtoBuf) |