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
About Question enthuware.ocpjp.v11.2.3634 :
Moderator: admin
-
- Posts: 8
- Joined: Mon Nov 02, 2020 10:21 pm
- Contact:
-
- Site Admin
- Posts: 10113
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3634 :
You are right. That should be just TestClass and not TestClass.java
Fixed.
thank you for your feedback!
Fixed.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
-
- Posts: 8
- Joined: Mon Nov 02, 2020 10:21 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3634 :
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
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
-
- Site Admin
- Posts: 10113
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.3634 :
Right.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: Google [Bot] and 12 guests