Using SSJ with Eclipse

Eclipse is an Integrated Development Environment (IDE) written in Java. It can be used to edit Java files, it contains an integrated compiler, a debugger, etc.

Using SSJ with Eclipse simply requires the setup of the build path in order to tell Eclipse where the classes can be found. A one-time setup is needed to link Eclipse with the classes, and a project-specific part adds SSJ to a project's build path. We will now detail these two steps. This procedure was tested with Eclipse 4.4, but it may work with newer versions of Eclipse. It should also work for using other third-party libraries with Eclipse.
Instructions written previously for Eclipse 3.2, an older version, can be found here.

See the home page and on-line help of Eclipse for more information on how to use this IDE.

Valid XHTML 1.0 Strict

Adding SSJ as a user library

When Eclipse is launched, a window like the next figure will appear.

Starting screen of Eclipse.

Go to the menu tool <Window> and select <Preferences> to open the Preferences window.
(Note for Mac users: <Preferences...> should be located in the menu <Eclipse>.)

Open the Preferences window from the menu tool.

In the left part of the Preferences window, select <Java>, <Build Path> and <User Libraries>.

Users libraries in the Preferences window.

Click on the button <New...> and a dialog box will pop up. Eclipse asks for the name to give to the new user library. The user can enter any meaningful name, e.g., SSJ.

Enter name of the new library.

Press the button <OK>. The library SSJ should now appear in the list of user libraries, like in the next figure.

Add external JARs to the new library.

Click on the button <Add External JARs...> and a dialog box will open. Select every JAR file in the lib subdirectory of SSJ. After the operation, the archives appear as children of the user library, like in the next figure.

JAR files for SSJ added.

The Preferences window can now be closed by clicking on the button <OK>.




Using SSJ in a project

In Eclipse, a project in Java can be created by going to the menu tool <File>, <New> and then <Java Project>. In this example, we will name the new project as TestSSJ.

Create a new Java project in Eclipse.

Now, do a right-click on the project (that needs the library SSJ) in the Package Explorer panel, found on the left side of the Eclipse window.

Open the Properties window of the project.

Select the menu item <Properties> and the Properties window will open. On the left panel, select <Java Build Path>, then click on the <Libraries> tab. The Properties window should now be similar to the next figure.

Go to the Libraries tab inside the Properties window.

Press the button <Add Library...>. The dialog box named Add Library will appear. Select <User Library> like in the next figure.

Choose to add a User Library.

Press the button <Next>. Select the library SSJ from the list of libraries, and click on the button <Finish>.

Add the SSJ library.

Press the button <OK> to close the Properties window. The library SSJ with all its JAR files should now appear in the Package Explorer panel of the project.

SSJ library is now ready to be used.

The project can now use the library SSJ, as shown by the example file Test.java.