<div dir="ltr">Hi,<div><br></div><div>I have been trying to generate a CFG (control-flow graph) by using Soot. First I tried to run Soot on command-line and I have been following the instruction on the link.</div><div><br></div><div>Here are a couple of trials I have made and the errors I have received.<br></div><div><br></div><div>1)</div><div>Command: java -cp soot-2.5.0.jar soot.Main -cp . -process-dir ..\....\myJavaProject</div><div><br></div><div>Error: Exception in thread "main" java.lang.RuntimeException: couldn't find class: xxx.yyy.zzz.MyClass (is your soot-class-path set properly?)</div><div><br></div><div>"xxx.yyy.zzz.MyClass" is one of the package and class information that is in "myJavaProject"<br></div><div><br></div><div>2)</div><div>Command: Command: java -cp soot-2.5.0.jar soot.Main -cp . -pp -process-dir ..\....\myJavaProject</div><div><br></div><div>Error: Exception in thread "main" java.lang.RuntimeException: couldn't load classfile: java.io.ObjectInputStream</div><div><br></div><div>=============================================</div><div><br></div><div>However, when I try to process a single .java file within the same directory with soot-2.5.0.jar I get a different error.</div><div><br></div><div>3)</div><div>Command: java -cp soot-2.5.0.jar soot.Main -cp . MyClass</div><div><br></div><div>Error: Exception in thread "main" java.lang.Error: Error loading java.util.regex.Pattern</div><div><br></div><div>So tried to use by giving rt.jar's path.</div><div><br></div><div>4) Command: java -cp soot-2.5.0.jar soot.Main -cp . ..\...\Java\jre1.8.0_111\lib\rt.jar MyClass</div><div><br></div><div>Error: Exception in thread "main" java.lang.RuntimeException: couldn't find class: ..\...\Java\jre1.8.0_111\lib\rt.jarĀ (is your soot-class-path set properly?)</div><div><br></div><div>Or another option</div><div><br></div><div>5) Command: java -cp soot-2.5.0.jar soot.Main -cp . -pp MyClass</div><div><br></div><div>Error: Exception in thread "main" java.lang.RuntimeException: couldn't load classfile: java.io.ObjectInputStream</div><div><br></div><div>I wanted to generate a CFG by using the "dump-cfg", but it seems that I got stuck with the basics. I would really appreciate any with to generate a CFG of a Java project.</div><div><br></div><div>Or rather than running Soot on command-line, is it possible to generate a CFG by using soot-2.5.0.jar as a library. If yes, could you please show me how to do it?</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Ekin</div></div>