Possibility to create modular jars out of old non-modular ones

Waldek Kozaczuk jwkozaczuk at gmail.com
Thu Sep 8 13:11:16 UTC 2016


Imagine you have pre-jigsaw jar like log4j 1.x that happens to depend on
java.awt.* and swing (it does in fact) but I know for a fact my app does
not use this part of it.

Would it be possible to create a modular jar out of non-modular by simply
repackaging it and adding module-info.java that specifies what specifically
my app depends on (is exposed in log4j jar) and what that log4j in my case
"requires" from Java 9 in terms of modules?

If possible then jlink could rely on this information and build according
minimal image.


More information about the jigsaw-dev mailing list