For uDig development a few changed to default Eclipse preferences settings will be needed.
Please start up Eclipse (as described in the previous step).
Java > Code Style > Coding Template
The code template supplies the default header header for udig project files, and offers a great starting place for your javadocs.
- From the eclipse menu bar select Window>Preferences
- In the Preferences Dialog navigate to the page Java>Code Style>Code Templates
- Press the 'Import ...' button
- Select the file:
C:\java\udig\trunk\extras\net.refractions.udig.dev\codetemplates.xml
(from the doc project you checked out earlier)
- Select the file:
- Or downloaded directly from svn: http://svn.refractions.net/udig/udig/trunk/extras/net.refractions.udig.dev/codetemplates.xml
- Confirm that the uDig header is available for "New Java Files" as shown.
Java > Code Style > Code Formatter
Rather than burden you with a bunch of coding conventions we are making use of the Eclipse Code Formatter.
- Open up Windows>Preferences and Navigate to Java>Code Style>Formatter
- Press the 'Import ...' button
- Select the file:
C:\java\udig\trunk\extras\net.refractions.udig.dev\codeformatter.xml - Or downloaded directly from svn:
http://svn.refractions.net/udig/udig/trunk/extras/net.refractions.udig.dev/codeformatter.xml
- Select the file:
- Confirm that the the profile is named uDig 1.0 as shown.
Java > Compiler
The default java compiler settings do not work for the udig application, you will need to change these before your first build.
- Open up Window>Preferences and Navigate to Java>Compiler
- On the 'Compliance and Classfiles' tab change the following:
- Compiler compliance level: 1.5
- Everything else will be defaulted as required
Java > Compiler > Building
- Open up Window>Preferences and Navigate to *Java > Compiler > Building
- Toggle to arrow next to Output folder and add .svn to the list of Filtered Resources
Note that missing this step would double your build times!
Java > Compiler > Errors/Warnings
We are interested in making the following change:
| Code style | Level |
|---|---|
| Non-externalized strings (missing/unused $NON_NLS$ tag) | Warning |
- Open up Window>Preferences and Navigate to Java> Compiler > Errors/Warnings
- Open the Code Style category and change to match the following:
Java > Installed JREs
We need to ensure that you picked up a JRE with JAI and ImageIO included:
- Open up Window > Preferences and navigate to Java > Installed JREs
- Select your JRE from the list and press Edit
- Ensure JRE system libraries includes the following jars:
- jai_codec.jar
- jai_core.jar
- jai_imageio.jar
- If they are not there you can fix this using the "Add External JARs" button. You should find these jar files the jre/lib/ext/ folder. If they are not there check that you installed JAI and ImageIO are use a search utility to find them.
- Here is what that looks like:
- Optional: To make Javadocs available while developing select the rt.jar above and press the Source Attachment... button. You can select a src.jar from any JDK on your system.
Plug-in Development > Compilers
Keep extension point documentation current:
- Open up Window>Preferences and Navigate to Plug-in Development>Compilers
- On the 'Schemas' tab check Generate reference documentation from schemas
Optional Settings For Working Around Problems
Run/Debug > Launching (Eclipse 3.3.1.1 Only)
Recommended if you have a slow machine (or as a workaround for an Eclipse 3.3.1.1 problem with automatic build running multiple times prior to launch).
- Select Window > Preferences and navigate to Run/Debug > Launching page
- Turn "wait for ongoing build to complete before launching" to PROMPT
- Uncheck "Build (if required) before launching
- Here is what that looks like:
Apply your Changes
- Press the OK to save these new preferences
- You may need to let Eclipse "do a full rebuild", since we have no code yet this will be quick

Previous: 06 Additional Eclipse Plugins Next: 08 Importing the Source Code