Hi.
I started studying for the
Java 11 OCP exam (part I) and I was going through the review questions for chapter 1. I came across
question 14 (chapter 1, page 32), which sounds like this:
Which options are valid on the jar command without considering module options? (Choose all that apply.)
A. -c
B. -C
C. -cp
D. -d
E. -f
F. -p
The answer to the question states the following:
A, B, C, E. When creating a jar file, you use the options -cf or -cvf, making options A and E correct. The jar command allows the use of the classpath, making option C correct. It also allows the specification of a directory using -C, making option B correct. Options D and F are incorrect because -d and -p are used for modules.
I am a bit confused by the part in bold, because I did not remember seeing the classpath option as valid for jar. I've also checked the
official documentation for jar and I did not find any reference to -cp (I think java -cp could be valid if -c stands for create and p for the module path, if I am not mistaken).
This looks like an error in the study guide, which means only A, B and E are correct. If this isn't the case, can someone please explain?
L.E. I've just seen it in the official errata, but it was at the bottom of the list. This is indeed an error.
Thank you!