Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

OSP Programming

Development Environment

Eclipse IDE showing a programming error.

Large development projects are more efficiently managed using an integrated development environment (IDE) such as Eclipse, Sun's NetBeans, or Apple's XTools. Although OSP code is written in standard Java and can be compiled with any Java development environment, we have chosen to use Eclipse. The Eclipse IDE provides color coded syntax highlighting and syntax checking as well as access to tools such as the the jar archive builder and the javadoc documentation generator. Eclipse can easily incorporate the OSP source code library and examples in a single workspace thereby allowing debugging and single-stepping through an entire program. And most importantly, the Eclipse IDE provides easy access to documentation. Highlighting a method or variable name and right-clicking (control or option clicking in some operating systems) takes the user directly to the source code and documentation for the given object or variable.

Eclipse is available for Mac OS X, Windows, Linux, and Solaris. Although it supports multiple programming languages, it is written in Java and is an excellent Java IDE. Eclipse is open source and is freely available from the Eclipse organization.

OSP Eclipse Workspace

The Open Source Physics Eclipse workspace contains the source code for the OSP core library, the OSP User's Guide by Wolfgang Christian, and An Introduction to Computer Simulation Methods by Harvey Gould, Jan Tobochnik and Wolfgang Christian. Download and unzip the OSP Eclipse workspace onto a local computer and open this workspace from within Eclipse using the File | Switch Workspace menu item from the main menu bar.

OSP Eclipse Workspace

Additional OSP Eclipse projects are available. They can be found by searching ComPADRE for source code or Eclipse. Programmers wishing to adopt the Open Source Physics (OSP) library for their own projects are encouraged to do so provided that these projects release their source code under the GNU Open-Source GPL license.

Obtaining Java

The Java Development kit (JDK) contains the Java compiler and other tools need to develop and distribute Java programs. This software must be installed before you can run Eclipse or compile OSP programs. Some vendors preinstall the JDK as part of their standard operating system distribution and many operating system support sites (see for example, Ubuntu Linux) post the JDK as an easy-to-install package. The standard Sun Microsystems JDK is available for Windows, Solaris, and Linux from the Sun Developer Network.

http://java.sun.com/javase/

The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics