Java Development Environment

Notes on how to set up a Java development environment.

Coding Standards

Establish well known standard policies or guidelines for the following items. Enforce them by code reviews and peer pressure. It will pay dividends during maintenance.

Code Formatting

Logging

Configuration settings

Exception Handling

Naming Conventions

Directory Structure

/project_name
  /classes
  /conf
  /dist
  /doc
    /javadoc
    /manual
  /lib
  /src
  /test
  build.xml
  license.txt
  readme.txt
  start

Javadocs

Write useful javadoc comments. Document non-obvious aspects: can the class be subclassed? is it thread safe? Are there constraints on how the class should be used? Are there any dependencies? Configuration options? What is the behaviour of a method when a null parameter is passed in?

A valuable comment answers the question why. Do not do this:

/** gets the Foo */

Build Process

A solid build process enables iterative development with short cycles and rapid feedback. It makes it easy to do the right thing by making it automatic. The build process goes hand-in-hand with quality control, running unit tests and code analysis tools as part of a nightly (or more often) build.

Build Scripting

Source Control

Continuous Integration

Martin Fowler and Matthew Foemmel on Continuous Integration.

Book: Pragmatic Project Automation

Quality Control

Unit Testing

Bug Tracking

Code Analysis Tools

Development Tools

IDEs

Text Editors

JDK and JRE

Project Website

The web is a powerful communication tool. Use it. Look to open source projects for plenty of examples of good project websites.

A project website can provide open access to project status, specs, policies, documentation, schedule, feature requests, bugs, etc. It can serve as a repository for jars and development tools. Other nice-to-have options are a project wiki, or mailing list.

by: J. Christopher Bare
last updated: Wednesday, August 31, 2005

References

Cordrey, Glen
"Setting Up a Java Shop"
JDJ volume:10 issue:8 Aug 2005