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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
silvia.cazan
Posts: 1
Joined: Thu Jun 04, 2020 6:31 am
Contact:

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

Post 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."

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

You are right. The answer and the explanation have now been fixed.
thank you for your feedback!
Paul.

joseph_xltq
Posts: 1
Joined: Mon Dec 19, 2016 12:38 pm
Contact:

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

Post 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

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

You are right. Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests