About Question enthuware.ocpjp.v11.2.3634 :
Posted: Wed Dec 02, 2020 3:18 pm
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
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