This makes JAnsi JPMS aware/enabled by giving it an Automatic Module Name. Jars with an automatic module name when loaded on the module path are treated as a JPMS module with the given name, with ALL packages in the jar exported.
This generates a module-info.class instead of adding Automatic-Module-Name to the manifest. In this case only the following packages are exported from the org.fusesource.jansi module:
org.fusesource.jansi
org.fusesource.jansi.io
No other packages defined in JAnsi are visible to other modules. This regresses using JLine as a JPMS module because it is no longer able to access the package org.fusesource.jansi.internal which is used in the classJansiWinSysTerminal:
If you attempt to use JLine as a JPMS Module then you will get the following error:
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.IllegalAccessError: class org.jline.terminal.impl.jansi.win.JansiWinSysTerminal (in module org.jline) cannot access class org.fusesource.jansi.internal.Kernel32 (in module org.fusesource.jansi) because module org.fusesource.jansi does not export org.fusesource.jansi.internal to module org.jline [in thread "main"]
A short-term fix would be to roll back to the JPMS configuration of 2.4.0.
The right fix would be to either decide that yes, org.fusesource.jansi.internal is part of the public api and export it. Or to add a conditional export so that only jline can see it.
In Jansi 2.4.0 this is the JPMS configuration:
This makes JAnsi JPMS aware/enabled by giving it an Automatic Module Name. Jars with an automatic module name when loaded on the module path are treated as a JPMS module with the given name, with ALL packages in the jar exported.
This is the JPMS configuration in 2.4.1
This generates a
module-info.class
instead of addingAutomatic-Module-Name
to the manifest. In this case only the following packages are exported from theorg.fusesource.jansi
module:org.fusesource.jansi
org.fusesource.jansi.io
No other packages defined in JAnsi are visible to other modules. This regresses using JLine as a JPMS module because it is no longer able to access the package
org.fusesource.jansi.internal
which is used in the classJansiWinSysTerminal
:If you attempt to use JLine as a JPMS Module then you will get the following error:
A short-term fix would be to roll back to the JPMS configuration of 2.4.0.