Closed terry2012 closed 7 years ago
soot.SootResolver$SootClassNotFoundException: couldn't find class: XXX (is your soot-class-path set properly?) at soot.SootResolver.bringToHierarchy(SootResolver.java:228) at soot.SootResolver.bringToSignatures(SootResolver.java:266) at soot.SootResolver.bringToBodies(SootResolver.java:304) at soot.SootResolver.processResolveWorklist(SootResolver.java:163) at soot.SootResolver.resolveClass(SootResolver.java:131) at soot.Scene.loadClass(Scene.java:707) at soot.Scene.loadClassAndSupport(Scene.java:692)
Can you please provide a full example, including your full Soot command-line?
My case is a bit complicated. I write the Soot command line into a Linux shell script. The dir is as follows:
MyDir/ MyDir/bin/mycmd.sh MyDir/MySoot/bin/MyMainClass.class MyDir/lib/*.jar MyDir/test/Target.class
mycmd.sh contains the following command line
java -Xmx2g -cp .:../MySoot/bin:../lib/soot-2.5.0.jar:../lib/commons-cli-1.2.jar:$infoflow:$androJar MyMainClass -c $1
I run the following command in the test dir:
$ ../bin/mycmd.sh Target
This command-line looks like you are not starting Soot, but a class called MyMainClass. Where is the Soot main method invoked? Furthermore, I cannot see your Soot classpath. Where is it set? You need to point your Soot classpath to the "MyDir/test" directory.
MyMainClass is a tool based on Soot API. I do not invoke Soot main, but just use Soot APIs.
I use "." in the command line, which points to the "MyDir/test" directory.
Is it correct to use "-cp" to set the Soot classpath? When I am using soot-2.5.0.jar, my program can see the class path is correctly set. That is ".:../MySoot/bin:../lib/soot-2.5.0.jar:../lib/commons-cli-1.2.jar:$infoflow:$androJar". But once I replaced it with soot-trunk.jar, no class path except JDK path can be outputted.
You need to make sure that the directory "../MyDir/Test" is on the Soot classpath. If your MyMainClass class uses the Soot API, this class is responsible for correctly configuring the Soot classpath. Note that the Soot classpath is completely independent from the JVM's classpath.
I see. Thank you for the help.
So Soot after 2.5 now would not automatically set class path from --cp.
I just call extendSootClassPath() in my code to fix this issue.
I have a same problem as @rockflying in https://github.com/Sable/soot/issues/284
Everything is fine for soot-2.5.0.jar, but once I replaced it with soot-trunk.jar, I got this error:
couldn't find class: XXX (is your soot-class-path set properly?)
Indeed, I checked the soot class in the program:
System.out.println("Soot class path " + Scene.v().getSootClassPath());
And found that when I am using soot-trunk.jar, the class path is only as follows (i.e., miss the class path I specified in the command line):
/usr/lib/jvm/java-7-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jce.jar
But when I use soot-2.5.0.jar, the outputted class path is the same as my command line specified by
'java -cp ...'
@StevenArzt Any hint for addressing this problem? Thanks a lot. My OS is Ubuntu 15.10.