On 8/9/17 7:39 AM, Oliver Siegmar wrote:
I have to create a Java 9 modularized jar file programmatically.
I noticed, that the compiled module-info.class file gets modified (main-class,
module-version and modules-hash) by the jar command line tool (using
Unfortunately, neither the ModuleInfoExtender itself nor the used asm-lib is
exported to allow external use. Is it planned to change this in the final
release of Java 9?
ModuleInfoExtender is JDK internal API and not planned to be
exported/opened. New version of ASM supports module-info.class. You can
probably try out ASM 6 alpha version for now.
I think, it is a bit scary, that the binary version of module-info.class gets
manipulated to create a jar file. Having to re-implement this functionality in
3rd party tools (like Ant, Maven, Gradle, etc.) doesn’t make it better ;-)
To be clear, the jar tool does not change Module attribute but it may
add optional attributes. I don't see how it can be scary to you.