Discover modulename

Robert Scholte rfscholte at
Thu Aug 25 10:26:48 UTC 2016


In an old thread I asked this before and got the following answer:
"One way is `jar --file foo.jar -p`. That will print the module descriptor  
when the JAR file is a modular JAR. There is API support for reading the  
binary form of the module declaration too."

With the renaming of the arguments I assume it is now:
jar --file foo.jar --print-module-descriptor

However, this gives me an exception on the asm-6.0_ALPHA.jar

d:\jdk-9\bin\jar --file asm-6.0_ALPHA.jar --print-module-descriptor
java.lang.module.InvalidModuleDescriptorException: Index into constant  
pool out of range
java.lang.module.ModuleInfo.invalidModuleDescriptor(java.base at 9-ea/

How about jars without module descriptor? Is there a commandline option to  
discover what the name of an automodule will be? I could guess the name,  
but I'd prefer to show the calculated name.


More information about the jigsaw-dev mailing list