Mar Na, you have 6 posts now that dance around but never really come out and tell what you are trying to accomplish.

In a few I see ready to use tools that have source so I would be left guessing what your big picture is here.

Do yourself a solid and reveal your big picture.

package javaapplication12;
public class  CyclomaticComplexity {
public static void main(String[]argv) throws ClassFormatException, IOException {

ClassParser parser=new ClassParser(CyclomaticComplexity.class.getResourceAsStream("/javaapplication12/CyclomaticComplexity.class"),"CyclomaticComplexity.class");
    JavaClass javaClass=parser.parse();

Mr. rproffitt ,in this my code,java parser ,parsing only existing class in existing package,i want to modifiy class path and writing other class path from other package but isn't work!?

Edited 9 Months Ago by Mar. Na.

Look at the constructors for ClassParser. You are using the one that takes an input stream, which you get from you current class loader. It would be a lot easier to use the constructor that takes a file name, or if your class is in a jar, the one that takes a zip file and a file name.

Edited 9 Months Ago by JamesCherrill

How can i use it ? is there any example or website that clarify this?

It's a simple constructor. If you don't know how to use it then, to be honest, you are not yet ready to start using tools like this.

Ok , I know how to use it but , when I write path I get error ...

Edited 9 Months Ago by Mar. Na.

This article has been dead for over six months. Start a new discussion instead.