Running with Eclipse

There are several plugins you need before you start working on the projects. This section will explain on how to install and configure all of them. First make sure that the JavaME development toolkit is installed and accessible on your computer.

EclipseME plugin

You need to install EclipseME plugin. You'll find installation instructions here .

When EclipseME is installed you should configure it to use CLDC 1.0. Please go into Window / Preferences / J2ME / Device Management and select the MediaControlSkin profile (this profile is used by default by all BTW projects). Click the Edit button, then the Libraries tab. Remove the cldcapi11.jar , click Add , browse into the WTK2.2 directory, then into the lib directory and select cldcapi10.jar . Click OK, clean all projects and it should hopefully work :)

Subclipse plugin

Please install Subclipse plugin, an SVN support for Eclipse. There is a manual for installing the plugin into Eclipse. You should use the 1.1.8 (or newer version) because of the symlink support added. You'll find more details here . If you do not want to use experimental versions you may stick with 1.0.10, it is reported to be working okay.

Getting the project

There are two ways to get the project - first by getting an official release, second by checkouting the project from SVN. First, create a workspace in Eclipse (let's say /home/user/eclipse/btw ) and then:

  • Get whole zipped eclipse projects simply by download the * file from the SourceForge download link . Unzip the files into workspace then import them in Eclipse. If you are importing the BTLib project you need to strip the version name from the directory name, i.e. you need to rename the directory btlib-0.3 to btlib .
  • Use Eclipse's Import > Other > Project from SVN. SVN URL is publicly accessible at . Right-click on the project-name/tags/version directory and select Checkout from the menu. Just checkout the project into the workspace directory.

Configuring Eclipse

Any game/application will require a certain BTLib library version. You should first compile the game using Maven2 prior using it with Eclipse, to ensure that everything is okay and needed libraries are downloaded. Go into the workspace directory (the directory where the .metadata directory is located) and create the M2_REPO variable per these instructions .

To run J2ME application right-click on the main Midlet class (the class that extends the MIDlet class, for example the Btbs class in BTBS project), then Run as , Emulated J2ME Midlet . The application should crash with NoClassDefFoundError. Now select Run from main menu, then Run... , select the Btbs launch configuration, click on the Emulation tab and put the following into the Extra Emulator parameters editbox:

-classpath /home/vyzivus/.m2/repository/net/sf/btw/btlib/0.5-SNAPSHOT/btlib-0.5-SNAPSHOT-me.jar

Note: Replace the /home/vyzivus/.m2/repository by the path where the Maven2 repository is located (the value of the M2_REPO variable, check it in Window , Preferences , Java , Build path , Classpath variables . Save the launch configuration and run the application.

Note: Please use the correct btlib version as specified in pom.xml .