Using Eclipse for Ponder2 Development
Eclipse provides an excellent development environment for Ponder2. This page contains instructions for setting up Eclipse to use Sun's Java APT compiler which is necessary for compiling Ponder2 Managed Objects and generating the stub-code required for Ponder2.
Assuming that you have the latest release of Ponder2 in a directory called ponder2 it is easy to import it as a new project in Eclipse:
- Download either the source or binary release of Ponder2
If you have the source release then build the Ponder2 system by going into the ponder2 directory and typing ant build
- Open Eclipse
Create a new Java Project
- Give the project a name e.g. Ponder2
- Select "Create project from existing source" and select the ponder2 directory you created
- Expand the project
Remove the ponder2aptfactory.jar file (if present) from the build path
- Select the project and right-click to get the preferences/properties for the project
- Select Java Compiler | Annotation Processing and enable project specific settings and enable annotation processing
Open up the Annotation Processing triangle, select Factory Path, enable project specific settings and add the two necessary Jar files (qdparser.jar and ponder2.jar) from your lib directory as as shown. Use the Add Jars... button and locate your project and the lib directory. The project name Release will differ in your Eclipse setup
- Click OK to close the window
- Now run the Ponder2 sample object test
- Open the run configurations dialog
Select new application
Give it a name e.g. SampleObject
search for a main - select SelfManagedCell from the list
Select arguments and add -boot SampleObject.p2
- Click run
- You should see the following output in the console window
Shell: trying port 13570 Reading boot.p2 Reading SampleObject.p2 Adding: A line of text Retrieved: A line of text Shell port 13570 ready