-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b162
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8177619 | 10 | Chris Hegarty | P2 | Resolved | Fixed | b04 |
It would be useful for the jar tool to report the automatic module name that would be used if a regular jar file was put on the module path ( so there is an easy way for developers to determine the derived name ).
One way to achieve this is to repurpose the somewhat fingersome '--print-module-descriptor’ option, to report the automatic module name if the jar file does not contain a module-info.class. Given this, we should then probably give the option a better name, say ‘--describe-module’ ( similar to that of jmod's ‘describe’ subcommand ), e.g.
$ touch resource
$ jdk/bin/jar --create --file foo-6.jar resource
$ jdk/bin/jar --describe-module --file foo-6.jar
No module descriptor found. Derived automatic module: foo@6
It is also useful for the jar tool to indicate when a jar is not suitable to use as an automatic module, e.g.
$ jdk/bin/jar --create --file ttt.jar T.class
$ jdk/bin/jar --describe-module --file ttt.jar
Unable to derive module descriptor for: ttt.jar
T.class found in top-level directory (unnamed package not allowed in module)
One way to achieve this is to repurpose the somewhat fingersome '--print-module-descriptor’ option, to report the automatic module name if the jar file does not contain a module-info.class. Given this, we should then probably give the option a better name, say ‘--describe-module’ ( similar to that of jmod's ‘describe’ subcommand ), e.g.
$ touch resource
$ jdk/bin/jar --create --file foo-6.jar resource
$ jdk/bin/jar --describe-module --file foo-6.jar
No module descriptor found. Derived automatic module: foo@6
It is also useful for the jar tool to indicate when a jar is not suitable to use as an automatic module, e.g.
$ jdk/bin/jar --create --file ttt.jar T.class
$ jdk/bin/jar --describe-module --file ttt.jar
Unable to derive module descriptor for: ttt.jar
T.class found in top-level directory (unnamed package not allowed in module)
- backported by
-
JDK-8177619 jar tool support to report automatic module names
-
- Resolved
-