Discover modulename

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


Hi,

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
         at  
java.lang.module.ModuleInfo.invalidModuleDescriptor(java.base at 9-ea/ModuleInfo.java:804)


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.

thanks,
Robert


More information about the jigsaw-dev mailing list