Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.3439 :

Posted: Thu Jun 04, 2020 7:01 am
by silvia.cazan
Regarding automatic modules, they are said to be able to read every other module on the module path and/or class path without an explicit requires clause, because there is no module-info.java file.
Taken this into consideration, I think the last answer for this question is also correct and the explanation is incorrect:

"java  --module-path accounting-3.3.jar;reporting-5.6.jar --module reporting/com.abc.reporting.Main
By putting reporting jar on module path, it has been converted into an automatic module (which is a named module with name reporting without any requires clause.). However, a named module cannot access a class from another named module without appropriate requries clause. Therefore, this command will not work."

Re: About Question enthuware.ocpjp.ii.v11.2.3439 :

Posted: Thu Jun 04, 2020 10:12 am
by admin
You are right. The answer and the explanation have now been fixed.
thank you for your feedback!
Paul.

Re: About Question enthuware.ocpjp.ii.v11.2.3439 :

Posted: Tue Jul 28, 2020 10:52 pm
by joseph_xltq
Also, I think -add-modules would fix the second option, not -add-exports.
java -classpath reporting-5.6.jar --module-path accounting-3.3.jar; com.abc.reporting.Main

Re: About Question enthuware.ocpjp.ii.v11.2.3439 :

Posted: Tue Jul 28, 2020 11:08 pm
by admin
You are right. Fixed.
thank you for your feedback!