<div dir="ltr"><div>Hi,Hesam</div><div>First,you need to compile sample.java into .class file.</div><div>Then,put the sample.class file into project source directory.</div><div>At last,use <div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><font color="#666600"><span class="Apple-tab-span" style="white-space:pre"><span style="color: #000;" class="styled-by-prettify">                </span></span><span style="color: #606;" class="styled-by-prettify">Options</span><span style="color: #660;" class="styled-by-prettify">.</span><span style="color: #000;" class="styled-by-prettify">v</span><span style="color: #660;" class="styled-by-prettify">().</span><span style="color: #000;" class="styled-by-prettify">set_soot_classpath</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #008;" class="styled-by-prettify">new</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">File</span><span style="color: #660;" class="styled-by-prettify">(</span><span style="color: #080;" class="styled-by-prettify">&quot;&quot;</span><span style="color: #660;" class="styled-by-prettify">).</span><span style="color: #000;" class="styled-by-prettify">getAbsolutePath</span><span style="color: #660;" class="styled-by-prettify">());</span></font><span style="color: #000;" class="styled-by-prettify"><br></span></div></code></div><br>to set soot class path to contain your sample.class.</div><div>Hope this can help you.<br>在 2016年9月23日星期五 UTC+8上午6:11:45,hesam ghafouri写道:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div><div style="color:#000;background-color:#fff;font-family:bookman old style,new york,times,serif;font-size:13px"><div>Hello all,</div><div><div><br></div><div dir="ltr">It is very urgent. I searched a lot to find out how to load a java class to analyze using eclipse but I really couldn&#39;t find any solution. I want to do some static analyze on a java file (/Desktop/sampleFolder/sample.<wbr>java). I think I need to add this file (or its path) into my soot-class path, how can I do that in eclipse??? I know how to do it in command line. <br></div><div dir="ltr">What should I add in eclipse arguments?? Please help me if some one knows about that, its very urgent. Thank you in advance <br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Here is my code: (the only thing I want to know is how to load the sample class, I know the rest analysis)<br></div><div dir="ltr"><br></div>    public static void main(String[] args) {<br>        // TODO Auto-generated method stub<br>        <br>        Options.v().set_keep_line_<wbr>number(true);<br><br>        Options.v().set_whole_program(<wbr>true);<br><br>        Options.v().set_allow_phantom_<wbr>refs(true);<br>        <br>        Options.v().set_src_prec(<wbr>Options.src_prec_java);<br>        <br>        Options.v().set_output_format(<wbr>Options.output_format_jimple);<br><br>        Options.v().setPhaseOption(&quot;<wbr>cg.cha&quot;, &quot;on&quot;);<br>        <br><div dir="ltr">        SootClass sootClass = Scene.v().loadClassAndSupport(<wbr>&quot;sample&quot;);  //I copied the sample.java file in project src directory<br></div>        sootClass.setApplicationClass(<wbr>);<br><br>        for(SootMethod method : sootClass.getMethods())<br>        {<br>                //analyze codes<br>        }<br>        <br>        soot.Main.main(args);        <br><div dir="ltr">    }</div></div></div></div></blockquote></div></div>