[Soot-list] Load class from jar
Silviu ANDRICA
silviu.andrica at epfl.ch
Tue Jul 22 11:10:23 EDT 2008
Hello,
I tried the following trick:
static {
String javaClassPath = System.getProperty("java.class.path");
System.out.println("Setting classpath to: " + javaClassPath);
Scene.v().setSootClassPath(javaClassPath);
}
And the corresponding output is:
Setting classpath to:
.:/home/slv/Desktop/soot/soot-2.3.0/jasmin-2.3.0/lib/jasminclasses-2.3.0.jar:/home/slv/Desktop/soot/soot-2.3.0/polyglot-1.3.5/lib/polyglot.jar:/home/slv/Desktop/soot/soot-2.3.0/soot-2.3.0/lib/sootclasses-trunk.jar
And still have the same problems.
Silviu
Eric Bodden wrote:
> There are two different classpaths: (1) the classpath that Soot uses
> to run, which you set with your JVM's -cp parameter, and (2) Soot's
> classpath, which it uses to analyze programs, and which you set using
> *Soot's* -cp parameter. It seems like you have to put your
> sootclasses.jar on the latter.
>
> Eric
>
> 2008/7/22 Silviu ANDRICA <silviu.andrica at epfl.ch>:
>
>> Hello,
>> again, many thanks. I seem to run into some trouble when I try to play
>> with classes that use soot.
>> I get the following error:
>> java.lang.RuntimeException: couldn't find class: soot.Value (is your
>> soot-class-path set properly?)
>> at soot.SootResolver.bringToHierarchy(SootResolver.java:174)
>> at soot.SootResolver.bringToSignatures(SootResolver.java:209)
>> at soot.SootResolver.processResolveWorklist(SootResolver.java:139)
>> at soot.SootResolver.resolveClass(SootResolver.java:124)
>> at soot.Scene.loadClass(Scene.java:390)
>> at BytecodeToJimple.run(BytecodeToJimple.java:146)
>> at BytecodeToJimple.main(BytecodeToJimple.java:112)
>>
>> Best regards,
>> Silviu
>> Martin Bravenboer wrote:
>>
>>> Hi,
>>>
>>> I wrote a small standalone tool that loads class files only from the
>>> jar/zip and .class files specified at the command-line. It's a tool
>>> for converting bytecode to Jimple. The nice thing about this is that
>>> the tool never accidentally loads class files from a location you
>>> don't expect: everything is explicit. If you want to write your own
>>> Soot main program and tweak the way classes are loaded, then this
>>> might be a useful example.
>>>
>>> The SVN location of the package:
>>> https://svn.strategoxt.org/repos/mbravenboer-public/soot-tools/trunk/
>>>
>>> The Soot ClassProvider implementation:
>>>
>>> https://svn.strategoxt.org/repos/mbravenboer-public/soot-tools/trunk/name/bravenboer/martin/soot/NoSearchingClassProvider.java
>>>
>>> There is a small README in the trunk that explains how to use the tool.
>>>
>>> Hope this helps,
>>> --
>>> Martin Bravenboer
>>> ---------------------------------------------------------------------
>>> Department of Computer and Information Science
>>> University of Oregon
>>>
>>>
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>>
>
>
>
> --
> Eric Bodden
> Sable Research Group
> McGill University, Montréal, Canada
>
More information about the Soot-list
mailing list