[Soot-list] soot
Eric Bodden
eric.bodden at mail.mcgill.ca
Thu Sep 14 23:26:16 EDT 2006
Hi.
The name of the class is "helloworld", not "helloworld.class". So just
try to replace this String in your code.
Eric
From: soot-list-bounces at sable.mcgill.ca
[mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of Peng Li
Sent: Thursday, September 14, 2006 7:30 PM
To: soot-list at sable.mcgill.ca
Subject: [Soot-list] soot
Hi,
I am writing a program to translate a very simple class helloworld.class
to helloworld.jimple, the helloworld.class is under the
C:\workspace\translator directory, but the eclipse always gave me the
mistake of "couldn't find class: helloworld.class (is your
soot-class-path set properly?)" whatever I tried different input
parameter for setSootClassPath(). Could anyone give me some suggestion?
appreciated your help. My code is as following,
import soot.*;
import soot.options.Options;
import java.io.*;
public class ClassToJimple {
public static void main(String[] args) throws IOException
{
Scene.v().setSootClassPath("C:/workspace/translator/");
SootClass c = Scene.v().loadClassAndSupport("helloworld.class");
String fileName = SourceLocator.v().getFileNameFor(c,
Options.output_format_jimple);
OutputStream streamOut = new FileOutputStream(fileName);
PrintWriter writerOut = new PrintWriter(
new OutputStreamWriter(streamOut));
Printer.v().printTo(c, writerOut);
writerOut.flush();
streamOut.close();
}
}
Thanks
Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060914/93f56c57/attachment.htm
More information about the Soot-list
mailing list