1 Installation of the Environment

This document guides you through the installation of the environment needed to work with StrutsME .

1.1 Sun Wireless Toolkit (WTK)

Download
Download the WTK from 'http://developers.sun.com/techtopics/mobility/' .
Installation
Execute the installationfile and follow the instructions. The directory you choose during the installation is up now called WTK_HOME. Set the systemenvironmentvariable WTK_HOME to the installationdirectory of the WTK.
In some cases there is a updatepatch available for the WTK here . If so, please do also install this updatepatch.

1.2 Obfuscation

For the deployment of a J2ME-Midlet a Obfuscator is needed. In StrutsME we use proguard for that task. If you want to use another obfuscator, you have to modify the build.xml files of the modules.

Download
http://proguard.sourceforge.net
Installation
Download the proguard3.5.zip (or higher version) and unpack it in a directory of your choice.
Environment
set the systemenvironmentvariable PROGUARD_HOME to the installationdirectory.

1.3 Maven

Maven is not really neccassary, but it would make the handling easier. For the future, it is planned to base the whole developmentcycle of StrutsME on maven. At now, StrutsME uses an elder version of maven, namely 1.02.

Download
http://maven.apache.org/maven-1.x/start/download.html
Installation
Download Maven 1.02 and install it. There is a short and comprehensive InstallationGuide for Maven on in German. Please create a local repository for maven. This could be done for
Linux
 
    $MAVEN_HOME/bin/install_repo.sh $MAVEN\_HOME/repository


Windows
 
%MAVEN_HOME%\bin\install_repo.bat %MAVEN_HOME%\repository


Environment
set the systemenvironmentvariable MAVEN_HOME to the installationdirectory.

1.4 Ant

The antversion needed to execute the buildfile is 1.6 or higher. The buildfiles are tested against 1.6.5.

Download
http://ant.apache.org
Installation
Download and install ant.
Environment
set the Systemenvironmentvariable ANT_HOME. Also you will have to set a variable called MOBILE_REPOSITORY, which is used in the buildfiles. The directory this variable points too is used as common repository for the ant-buildfiles. If you point this variable to the root of the local Mavenrepository, you can use the deployed jars also in maven. This means, you can refer to them in the project.xml of a mavenproject with the groupid strutsme.
Copy the to the MOBILE_REPOSITORY/strutsme/jars directory.

Antenna

To perform the antbuilds, the ant-plugin antenna is needed. Please download the jar, copy it to the WTK_HOME/lib directory and rename it too antenna-bin.jar.

1.5 Checkstyle

For developers and committers only. StrutsME is using checkstyle for checking the code. The resources\buildresources directory of the CommonModule contains a checkstyle-configurationfile.

1.6 Eclipse

The developers of this framework uses Eclipse as the Ide of their choice. If you prefer another Ide like Idea or Netbeans, you will have to translate the following steps.

Eclipse
Download and install Eclipse in a directory of your choice, if you not currently have a EclipseInstallation.
Plugins
install your desired plugins.
Checkstyle
use the 'http://eclipse-cs.sourceforge.net/update' url for the Checkstyle or download the Checklipse plugins from .
Userlibrary
For every WTK-Platform you want to use you have to specify a Userlibrary. See .
Debugging
To debug a Midlet, you have to modify the Eclipse-Debugproperties. Please select 'Window/Preferences' and then 'Java/Debug'. Uncheck the two topmost checkboxes
  • Suspend Execution on uncaught exceptions
  • Suspend Execution on compilation errors
. Finally increase the Debugger timeout in the Frame 'Communication' to a higher value, for example 15000. see figure 1


Abbildung 1: Debugsettings for Eclipse

Creating a Userlibrary

You can skip reading this section if you are generating your classpath via the maven:eclipse or maven eclipse:generate-classpath command.

Select 'Window - Preferences' and then select 'Java - Java-Buildpath - User Libraries'. Press the button 'New' to create new Userlibraries. You can find the jars for the libraries in the WTK\_HOME.lib-directory. For example see table 1. The javadoc for these jars are found in the WTK\_HOME\\docs\\api\\midp directory.

Platform jars
MobilePlatform 1.0 cldcapi1.0.jar, midpapi1.0.jar
MobilePlatform 1.1 cldcapi1.1.jar, midpapi1.0.jar
MobilePlatform 2.0 cldcapi1.1.jar, midpapi2.0.jar


Tabelle 1: Mobile Platform

Overview of the required Systemenvironmentvariables

Table 2shows a overview of the required Systemenvironmentvariables.

Environmentvariable Wert
WTK_HOME installationdirectory of the Wireless Toolkit
PROGUARD_HOME installationdirectory of Proguard
MOBILE_REPOSITORY locale directory, which is used during the buildprocess with ant.
ANT_HOME home of ant
MAVEN_HOME home of maven


Tabelle 2: required Systemenvironmentvariables

null