Soot Home

Create Project
Import Sources
Recognize Sources
Setup Libraries
Building
Running

Sable Home

Soot Home

Developing With Soot in Eclipse

Step 1: Creating a Project
  • Start Eclipse
  • Select File -- New -- Project
  • Select Java and Java Project
  • Click Next

  • Give a name to the project
  • Click Next
  • Click Finish

You should now have an empty project.

Step 2: Importing the Soot Source Files
  • Right click on your project and select Import
  • Select File System
  • Click Next
  • Use Browse to find your Soot source files
  • Select the Soot package root directory to import
  • Click Finish

You should now have the regular Soot source files in a src directory in your project.

You also need to import the generated src files. Make sure you have these built first. (They come built - but if you used ant veryclean at some point you may have deleted them.)

  • Right click on your project and select Import
  • Select File System
  • Click Next
  • Use browse to find the generated Soot sources directories.
  • Select the generated/options generated/singletons and generated/sablecc directories.
  • Click Finish
Step 3: Making Eclipse Recognize Source Files

Now you need to make Eclipse recognize these directories as src directories.

  • Right click on your project
  • Select Properties
  • From the tree on the right select Java Build Path
  • Pick the Source tab
  • Select Add Folder
  • Select your project src folder
  • Click Ok
  • Repeat for each of the generated folders
Step 4: Adding libraries needed by Soot

Now you need to add the Jasmin, Polyglot and Ant libraries, and the Soot classes, to your project.

  • Right click on your project
  • Select Properties
  • From the tree on the right select Java Build Path
  • Select the Libraries tab
  • Select Add External Jars
  • Use the dialog to select your jasminclasses.jar file
  • Click OK
  • Repeat for your polyglotclasses.jar file and ant.jar file
  • Select Add Class Folder and choose the "classes" folder to add the Soot classes
  • Click OK again
Step 5: Building your project
  • Select your project
  • Select Project -- Build Project

Your project should compile with no problems but there will be lots of warnings. You can ignore these. They are mostly for unused imports.

Step 6: Running your project
  • Select Run -- Run ... or Debug ...
  • Select Java Application
  • Select New
  • Use search to find the main class to run
  • Set arguments under the Argument tab