Open efferifick opened 5 years ago
The CLASSPATH
variable must allow the Java class loader to load all dependencies. You may need to update the distributed bcel to avoid the class reading problem. Please provide feedback if this helps.
Yes, adding all dependencies to java.class.path before calling MetricsFilter helps. I can wrap ckjm in a maven plugin and run it as mvn ckjm that would analyse target/*/.class.
What do you mean by adding all dependencies to java.class.path. Could you elaborate a bit more?
The path should contain all the directories and jar files used by the analyzed Java files.
I literally don't have any third party dependencies. Just a couple of directories containing simple classes and still it can't find the super class.
Never mind. I wasn't adding directory paths to CLASSPATH correctly. Thanks for help.
Hello, i get the same error when i try to use the program on some .class files with inner classes that are subclasses of the class that contains them. The strange thing is that it gives me an output for the problematic class.
Here is an example:
java -jar ckjm-1.9.jar -s ./*.class
Error obtaining all superclasses of class myAdapter.ListAdapter$SubListAdapter extends myAdapter.ListAdapter filename ./ListAdapter$SubListAdapter.class compiled from ListAdapter.java compiler version 55.0 access flags 32 constant pool 207 entries ACC_SUPER flag true
Attribute(s): SourceFile: ListAdapter.java (Unknown attribute NestHost: 00 0a) InnerClasses(2): private SubListAdapter=class myAdapter.ListAdapter$SubListAdapter of class myAdapter.ListAdapter private MyListIterator=class myAdapter.ListAdapter$MyListIterator of class myAdapter.ListAdapter
5 fields: private int startIndex private int endIndex private myAdapter.ListAdapter thisList private myAdapter.ListAdapter thisSubList final synthetic myAdapter.ListAdapter this$0
29 methods:
private void
myAdapter.HCollection 15 1 0 3 15 105 7 15 myAdapter.MapAdapter$BackingSetIterator 5 1 0 10 12 0 1 4 myAdapter.MapAdapter 17 1 0 14 45 4 3 17 myAdapter.ListAdapter$SubListAdapter 29 0 0 15 68 6 1 25 myAdapter.MapAdapter$MapAdapterEntry 10 1 0 10 21 13 1 9 myAdapter.HMap$HEntry 5 1 0 2 5 10 1 5 myAdapter.HMap 14 1 0 4 14 91 1 14 myAdapter.MapAdapter$BackingSet 18 1 0 20 57 37 3 17 myAdapter.HSet 15 1 0 4 15 105 3 15 myAdapter.ListAdapter 30 1 1 17 58 71 2 30 myAdapter.HIterator 3 1 0 2 3 3 9 3 myAdapter.ListAdapter$MyListIterator 12 1 0 13 26 0 2 11 myAdapter.HList 24 1 0 5 24 276 2 24 myAdapter.HListIterator 9 1 0 3 9 36 4 9
Hi,
I have done the following:
sunflow-0.07.2.jar
file from thedacapo.jar
file with the following command:jar xf dacapo.jar jar/sunflow-0.07.2.jar
.class
files from thesunflow-0.07.2.jar
file with the following command:jar xf sunflow-0.07.2.jar
find build -name '*.class' -print | java -jar /usr/local/lib/ckjm.jar
And I receive the following output:
For Error obtaining all superclasses of public class I am not sure if the PATH environment variable needs to be set somehow or if this is another error. Can you please comment on how to correct this mistake?
For Error reading line: org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18 Is
ckjm
only compatible with class files compiled under certain versions of the jvm? If so, which ones?Thanks!