Eclipse Configuration

Our Eclipse configuration is still rapidly evolving, but this entry documents the current state of the work in progress. If you are configuring Eclipse at home or on a borrowed laptop, please stick as closely as you can to these guidelines to stay compatible. If they don't work out, please report problems so that updates can be made to this document.

Installation

The version of Eclipse that one by default downloads from eclipse.org is constantly updated. In order to stay synchronized with as many other students and teachers as possible, please use the presently preferred 64-bit or 32-bit version. Please report any problems you encounter.

Workspace

It is probably a good idea to store your workspace directly on your flash drive. That way you don't have to copy anything to or from the local drive. The directory structure on students' flash drives differ, so it will be helpful to have Eclipse continue to ask what workspace to use. If you aren't asked about a workspace and don't get the right one, use the File menu to do a Switch Workspace and find yours. To restore the startup question about the workspace, use Window | Preferences | General | Startup and Shutdown | Workspaces and check "Prompt for workspace on startup".

Assertions

We occasionally use assertions to document preconditions and postconditions or as rudimentary unit tests. To enable assertions, use Window | Preferences | Java | Installed JREs. Edit the JRE you are using so that the Default VM Arguments include -ea.

JUnit

JUnit should already be installed. Simply attempt to add a new JUnit Test Case to a project and the appropriate things happen. Please select a New JUnit 3 test rather than version 4. The earlier version will result in a better template file, not require you to learn annotations, and stay compatible with BlueJ's tests.

objectdraw and GridWorld

All of the libraries (jar and zip files) that we use will be placed into a User Library called APCS. To create the library, use Window | Preferences | Java | Build Path | User Libraries to add a new one called APCS. To the library add the zip or jar files such as objectdraw that we will be using. If you switch computers and the new one has an APCS library configured, your project will use the files from on that computer or from the USB drive you have inserted. To add libraries to a project that is being newly created, begin a new project with File | New... | Java Project | Next> | Libraries | Add Library... | User Library | Next> | APCS | Finish. To add a library after a project has already been created, right click somewhere in the project shown in Package Explorer, choose Properties, find the Java Build Path and the Libraries tab. There you can continue to Add Library... | User Library | Next> | APCS | and Finish.