1

I'm trying to use SOOT to generate call graphs. However when I pass it some class to be analyzed, the exception NoClassDefFoundError is being thrown. I'm using the following two tutorials to be able to execute some of the commands: http://www.brics.dk/SootGuide/sootsurvivorsguide.pdf and http://www.bodden.de/2008/08/21/soot-command-line/#obtaining.

I have placed the java source code to be analyzed in the same classpath of the SOOT. So when i'm about to execute, i used the "." to specify the current directory. The following is the command I'm executing:

java -cp jasminclasses-2.5.0.jar:sootclasses-2.5.0.jar:plyglot-1.3.5.jar:.soot.Main -cp . MainFrame

The same error is being generated even if I leave the -cp out and just call the MainFrame immediately.

does anyone know why this kind of exception is being thrown?

rolve
  • 10,083
  • 4
  • 55
  • 75
ict1991
  • 2,060
  • 5
  • 26
  • 34
  • Add please full name of not found class. – kornero Feb 13 '12 at 10:11
  • Exception in thread "main" java.lang.NoCLassDefFOundError: MainFrame Caused by: java.lang.ClassNotFoundException: MainFrame Im assuming that the error is being generated because of the MainFrame itself and not because the soot.Main is generating some for of error. – ict1991 Feb 13 '12 at 10:18
  • Did you try to use full paths intead of relative? – kornero Feb 13 '12 at 10:25
  • i did and the same error is being generated – ict1991 Feb 13 '12 at 10:28

1 Answers1

0

The first classpath string looks weird and your actually not calling the soot.Main class. Give this a try:

java -cp jasminclasses-2.5.0.jar:sootclasses-2.5.0.jar:plyglot-1.3.5.jar soot.Main -cp . MainFrame

Edit

Regarding your last comment, it looks like a typical classpath error.

If you execute your line from the question above, Java tries to start the main method in class MainFrame (default package) - and can't find that class. With my (the correct!) command, java tries to find soot.Main.

Double-check your classpath again: you have to provide correct paths to the libraries. The actual command expects, that all three libraries plus MainFrame.class are in the current directory.

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
  • I've tried this form of input and in this case its giving me a NoClassDefFoundError on the soot/Main .... when i used the one I posted I even managed to get the help contents and version details so I'm guessing that that is not what has been generating the problem – ict1991 Feb 13 '12 at 10:22
  • *what* class isn't found, `soot.Main` or the analyzed class? – Andreas Dolk Feb 13 '12 at 10:37
  • if i place your specified command in the command line, the error generated will name the soot.Main class. However the error generated when I use the command which I stated, an error regarding the analyzed class will be generated... so in this case the soot.Main is not generated an error i think – ict1991 Feb 13 '12 at 10:43