Setting Up JPT in Eclipse

Step 1: Download the library jpt.jar

Download the JPT library jpt.jar and store this library in a convenient directory on your local file system.

Step 2: Set up a classpath variable reference JPT to jpt.jar in Eclipse

Define the classpath variable reference JPT in Eclipse 3.0

Define the classpath variable reference JPT in Eclipse 3.1

Step 3: Adjust the Eclipse compiler error/warning settings

To promote easier Java experimentation in Eclipse, we recommend changes to the default compiler error/warning settings.

Recommendations for compiler error/warning settings in Eclipse 3.0

Recommendations for compiler error/warning settings in Eclipse 3.1

Step 4: Create a sample project that is ready to use JPT

Set up a sample project that can use the JPT library jpt.jar in Eclipse 3.0

Set up a sample project that can use the JPT library jpt.jar in Eclipse 3.1

Step 5: Decide Java imports in a Java file

Some people prefer to add Java imports incrementally as particular library classes are used in the code. However, we have found that experimentation is enhanced if we do not have to stop and think about what Java libraries to import. Therefore, after years of experience, we recommend the following list of imports as a useful default. Later, when the design and coding of the class is complete, the list may be pared down to a minimal list. The import list below includes the JPT imports and the most frequently used Java imports.

import edu.neu.ccs.*;
import edu.neu.ccs.gui.*;
import edu.neu.ccs.codec.*;
import edu.neu.ccs.console.*;
import edu.neu.ccs.filter.*;
import edu.neu.ccs.jpf.*;
import edu.neu.ccs.parser.*;
import edu.neu.ccs.pedagogy.*;
import edu.neu.ccs.quick.*;
import edu.neu.ccs.util.*;

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.font.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.border.*;
import java.io.*;
import java.util.*;
import java.math.*;
import java.beans.*;
import java.lang.reflect.*;
import java.net.URL;
import java.util.regex.*;
import java.text.ParseException;

You may select the above list, copy it, and then paste it into the top of a Java file.

Eclipse offers the option of minimizing the import list so only the first line of the list is visible in the editor pane.

Step 6: Create Java Files

Using the Java imports in Step 5, you are ready to create Java source files that freely use both JPT and pure Java.

If you want an elegant environment for both experimentation and systematic testing, consider the Java Power Framework. For more information, click the link for Java Power Frame in the left hand panel.

For demonstration programs that use the latest features in JPT, click the link for Demonstrations in the left hand panel.

For older demonstration programs and access to the tutorial known as the JPT Book, click the link for JPT 2.3.5 in the left panel.

If you use the JPT 2.3.5 material, keep in mind the following change to JPT.

JPT 2.4.0 is almost 100% compatible with JPT 2.3.5 but not quite. One of the key forces leading to this release was the realization that the Paintable interface needed to have the mutatable properties that were formerly in MutatablePaintable. This led to the merger of the interfaces and to the deletion of certain support classes that were no longer necessary. The one class with some utility, namely, MutatableWrapper was renamed more simply to Tile.