Page 1 of 1

About Question enthuware.ocpjp.v11.2.3440 :

Posted: Wed Apr 07, 2021 8:03 am
by minajev3
Hello! Have few questions

1) jdeps --module-path lib\a.jar; -classpath lib\b.jar app.jar
where app.jar is our final app that uses lib/a.jar
- will still not work? because a.jar as named module cant use unnamed module b.jar but it is necessary

2) jdeps --module-path lib\b.jar;lib\a.jar app.jar
// should work because b.jar is auto module now and accessible from a.jar

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Wed Apr 07, 2021 8:29 am
by admin
1. Correct.
2. Correct.

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Thu Aug 24, 2023 3:57 pm
by Val Martinez
Hi:

Sorry but i don't catch the difference between

Could you explain why the first works and the second not?

1 jdeps --class-path lib\a.jar; lib\b.jar
2 jdeps -cp lib\b.jar lib\a.jar

How much important are the order and the semicolon? Thanks

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Fri Aug 25, 2023 12:07 am
by admin
1 jdeps --class-path lib\a.jar; lib\b.jar
This means, you want jdeps to analyze b.jar and if does not find any class that b.jar refers to, then you are asking it to look into the jar listed in the classpath i.e. a.jar

2 jdeps -cp lib\b.jar lib\a.jar
This means, you want jdeps to analyze a.jar and if does not find any classes that a.jar refers to, then look into the jar listed in the classpath i.e. b.jar. But a.jar is a modular jar (as given in the problem statement). A modular jar is not allowed to access classes present on the classpath. So, jdeps cannot use b.jar for the analysis of a.jar.

Semi-colon is not important. It is required (on windows) only as a path separator when you are listing multiple jars or paths in the classpath.

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Sun Aug 27, 2023 5:03 am
by Val Martinez
The problem for me with this kind of questions is that they are absolutely theoretical and it is quite strange that you have to work with this in a real enviroment.

Anyway, i got the key: "you can work with named modules from the classpath but not the contrary" and "jdeps starts its analysis from the rightest element". ¿Am I OK?

One more about this one:

Last option is

"jdeps -cp lib\b.jar;lib\a.jar" and the explanation says --> "A target path is required"

If semi-colon is just a separator on Windows, why the explanation is totally different to the other option

"jdeps -cp lib\b.jar lib\a.jar" where the problem was on loading non-modular jars from the module-path

???
Thank you again for your time and patience.

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Sun Aug 27, 2023 9:41 am
by admin
You need to look at the presence of space in those options.
1."jdeps -cp lib\b.jar;lib\a.jar"
In this case, lib\b.jar;lib\a.jar is the classpath that you want jdeps to use. But what is jdeps supposed to analyze? Where is the target?

2. "jdeps -cp lib\b.jar lib\a.jar"
In this case, there is a space between lib\b.jar and lib\a.jar. So you are asking jdeps to use lib\b.jar as the classpath and lib\a.jar is what you want jdeps to analyze. So that is the target.

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Sun Aug 27, 2023 10:48 am
by Val Martinez
admin wrote:
Sun Aug 27, 2023 9:41 am
You need to look at the presence of space in those options.
1."jdeps -cp lib\b.jar;lib\a.jar"
In this case, lib\b.jar;lib\a.jar is the classpath that you want jdeps to use. But what is jdeps supposed to analyze? Where is the target?

2. "jdeps -cp lib\b.jar lib\a.jar"
In this case, there is a space between lib\b.jar and lib\a.jar. So you are asking jdeps to use lib\b.jar as the classpath and lib\a.jar is what you want jdeps to analyze. So that is the target.
Ohh Already noticed! With a space between is obviusly other param :S Thanks!

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Thu Dec 21, 2023 10:43 pm
by yulinxp
For 4th option: jdeps -cp lib\b.jar lib\a.jar

Can jdeps analyze a.jar as non-module jar? Can module jar can be run as non-module jar?

Re: About Question enthuware.ocpjp.v11.2.3440 :

Posted: Fri Dec 22, 2023 4:59 am
by admin