title: Loading Java class files for Soot dynamically in Eclipse
body: <p>I am currently working on a program which compares two control - flow graphs  with each other(the graphs are generated with Soot).  These graphs belong to two different classes; so one cfg for each.  </p>
  
  <p>Currently I am using the following to load classes:</p>
  
  <pre><code>   SootClass sClassNew = Scene.v().loadClassAndSupport("Calc");     
     sClassNew.setApplicationClass();
  
     SootClass sClassOld = Scene.v().loadClassAndSupport("Calc2");        
     sClassOld.setApplicationClass()
  </code></pre>
  
  <p>This works if I add a folder with classes Calc.java and Calc2.java by right-clicking on the project | Java Build Path | Add External Class folder| choose the folder.</p>
  
  <p>Unfortunately this is not exactly what I want since: </p>
  
  <ol>
  <li>The two classes will have the same name since they are different versions of each other.  In other words, one class is an updated version of the other.</li>
  <li>When the program is executed, I want to make the user capable of choosing the files so that a cfg is built.  Therefore, I must eliminate the above steps so as to add the classes and need a way to add them at run-time.</li>
  </ol>
  
  <p>An important note is that Soot will only load files from JAR files and directories found on Soot's classpath. 
  Does anyone have an idea how I can solve problems these two problems please? </p>