Page 1 of 1

About Question enthuware.ocpjp.v11.2.3634 :

Posted: Wed Dec 02, 2020 3:18 pm
by olsongrant
I believe the correct answer is the one that refers to an exception trace being seen from the jdeps command.

The jdeps -summary TestClass.java doesn't work, as it doesn't seem to work with a java (text) file. I tried
jdeps -summary TestClass.java
and received an exception stack trace:
Exception in thread "main" com.sun.tools.classfile.Dependencies$ClassFileError
at jdk.jdeps/com.sun.tools.jdeps.ClassFileReader.scan(ClassFileReader.java:172)
at jdk.jdeps/com.sun.tools.jdeps.ClassFileReader.entries(ClassFileReader.java:121)
at jdk.jdeps/com.sun.tools.jdeps.Archive.contains(Archive.java:92)
at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.addRoot(JdepsConfiguration.java:510)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:583)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:543)
at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:519)
at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
Caused by: com.sun.tools.classfile.ConstantPool$InvalidEntry: unexpected tag at #1: 67
at jdk.jdeps/com.sun.tools.classfile.ConstantPool.<init>(ConstantPool.java:244)
at jdk.jdeps/com.sun.tools.classfile.ClassFile.<init>(ClassFile.java:82)

Then I tried with
jdeps -summary TestClass.class
and got the following result:
TestClass.class -> java.base
TestClass.class -> java.desktop
TestClass.class -> java.sql

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

Posted: Thu Dec 03, 2020 3:12 am
by admin
You are right. That should be just TestClass and not TestClass.java
Fixed.
thank you for your feedback!

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

Posted: Thu Dec 03, 2020 12:11 pm
by olsongrant
Actually, no. Just saying
jdeps -summary TestClass
doesn't work, either. Below is what I experience:

C:\code\java\ocp11\alone>jdeps -summary TestClass
Warning: Path does not exist: TestClass

C:\code\java\ocp11\alone>jdeps -summary TestClass.class
TestClass.class -> java.base
TestClass.class -> java.desktop
TestClass.class -> java.sql

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

Posted: Thu Dec 03, 2020 8:36 pm
by admin
Right. :oops: