This guideline provides information to setup the best practice development environment (please find the examples in the Download section.
Please follow all the instructions to assure the functionality of the development environment.
The best practice examples use the Java 6 technology. To compile and run them, you need to have JDK 1.6 installed (JRE is not sufficient).
Please download the latest version of the JDK at Java.sun.com. When downloading the JDK you might also consider downloading the API documentation for offline use.
After installing the JDK please make sure to set the JAVA_HOME environment variable to point to your java directory.
Example (for Windows users) Press WinKey + Pause, go to the Advanced Tab (Erweitert), click on Environment variables (Umgebungsvariablen), click 'New' at user variables (Benutzervariablen) and define a new entry as follows:
Value: path/to/your/JDK-installation (e.g: H:\Programme\Java\jdk1.6.0_17 - Note: not the bin-directory)
Go to your console/shell and use the following command (anywhere):
Output should look something like this (depends on the version you installed):
java version "1.6.0_17" Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0_17-b04) Java HotSport(TM) Server VM (build 1.6.0_17-b04, mixed mode)
Maven 2 is used to organize, build and deploy this application.
Run mvn --version (in your console) to verify that it is installed correctly. Output should look something like this (depends on the version you installed):
Maven version: 2.2.1 Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_17 Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x" version: "10.6.3" arch: "x86_64" Family: "mac"
Download the examples from Download section and unpack the archive to a folder of your choice.
After extracting the archive, you find the following folder structure
+- bpse | |`-- designpatterns | `-- subfolders | |`-- basic | `-- subfolders | |`-- documentation | `-- subfolders | `- pom.xml
(detailed information can be found at The sample apps section)
You then have to use Maven to download all required dependencies (used libraries in project; for more information see Maven technology page). Note: All mvn commands are executed in your console.
Execute mvn compile in the basic folder to automatically download all project dependencies to you local maven repository and compile the sources.
Optionally Execute mvn compile in the designpatterns folder
Optionally build the Documentation locally (this site): Execute mvn site in the documentation folder
We just extracted the archive to a desired folder. Now we want to use the basic example in Eclipse.
Now everything is ready to play around with the basic example (Integration of the designpatterns example is very similar).
The libraries used in the project should be available under Referenced Libraries in the Package Explorer of Eclipse - the mvn eclipse:eclipse command should already have added all dependencies to the classpath. These dependecies should all point to a classpath variable configured in Eclipse - "M2_REPO". You can optionally install a Maven plugin for Eclipse, but if you would like to configure this variable manually, you can go to Window - Preferences, select Java - Build Path - Classpath Variables and configure M2_REPO from there.