Page 1 of 1

enthuware.ocpjp.ii.v11.2.3440

Posted: Sun Jun 28, 2020 1:53 am
by roopamohan12
Question :

Your application uses one modular jar (a.jar), which, in turn, uses one non-modular jar (b.jar). Which of the following commands will cause jdeps to include the non-modular jar in its analysis?

One of the incorrect answers:


jdeps --module-path lib\a.jar; lib\b.jar

Explanation for incorrect answer:
If you put a.jar on module-path, then jdeps will try to build its module graph. It will look for module b (because it is given in the problem statement that a.jar uses b.jar). But b.jar is not on the module-path, so jdeps will given an error saying a required module b is not found.

Doubt:
If a non-modular jar is placed in the module path wont it become an automatic module? (b.jar placed on the module path will become an automatic module)So while resolving the module system will be able to find it and there will not be an error

Re: enthuware.ocpjp.ii.v11.2.3440

Posted: Mon Jun 29, 2020 2:24 am
by admin
But b.jar is not on the module-path. There is a space between lib\a.jar; and lib\b.jar, so basically, you are setting module-path to a.jar and asking jdeps to analyze b.jar, but b.jar is not on module path.


But yes, the following commands will work:

jdeps --module-path libs\b.jar libs\b.jar

jdeps --module-path libs b.jar

Re: enthuware.ocpjp.ii.v11.2.3440

Posted: Tue Jun 30, 2020 8:27 am
by roopamohan12
Thank you for the explanation!:)