Ok, so I used bb-ant-tools from
SourceForge .
I then had to make several changes to the build.xml Ant script. I'm just a beginner with Ant so I'm not sure if what I have is correct, but it does build my HelloWorld program.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="HelloWorld" default="buildRIM" basedir=".">
<taskdef resource="bb-ant-defs.xml" classpath="lib/bb-ant-tools.jar" />
<property name="jdehome" value="C:\Program Files\Research In Motion\BlackBerry
JDE 4.2.1" />
<property name="javahome" value="C:\Program Files\Java\jdk1.5.0_11"/>
<property name="simulator" value="${jdehome}\simulator" />
<property name="bin" value="${jdehome}\bin" />
<target name="debug" depends="buildRIM">
<copy todir="${simulator}" overwrite="true">
<fileset dir=".">
<include name="*.cod" />
<include name="*.debug" />
<include name="*.csl" />
<include name="*.cso" />
</fileset>
</copy>
<exec executable="cmd.exe" dir="${bin}" spawn="true">
<arg value="/c" />
<arg value="jdwp.bat" />
</exec>
</target>
<target name="simulate" depends="deploy">
<exec executable="cmd.exe" dir="${simulator}" spawn="true">
<arg value="/c" />
<arg value="8120.bat" />
</exec>
</target>
<target name="deploy" depends="buildRIM">
<copy todir="${simulator}" overwrite="true">
<fileset dir=".">
<include name="*.cod" />
<include name="*.debug" />
<include name="*.csl" />
<include name="*.cso" />
</fileset>
</copy>
</target>
<target name="buildRIM" description="Composes RIM">
<rapc jdehome="${jdehome}" jdkhome="${javahome}" output="helloworld" >
<jdp title="HelloWorld" vendor="IDRS" version="0.1" description="test program" runonstartup="false" type="cldc" />
<src>
<fileset dir=".">
<include name="**/*.java" />
<include name="resources/**/*.*" />
</fileset>
</src>
</rapc>
</target>
</project>
If you are going to use this, be sure to edit the property values for jdehome and javahome. You may need to change the simulator bat file to run (in the simulate target), and you will need to change the parameters to jdp in the buildRIM target.
All that said, I'm afraid the debugger did not work correctly. Here is my simple HelloWorld program.
Code:
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
public final class HelloWorld extends UiApplication
{
public HelloWorld()
{
super();
MainScreen screen = new MainScreen();
String s = "Hello World!";
screen.add(new LabelField(s));
pushScreen(screen);
}
public static void main(String[] args)
{
HelloWorld hw = new HelloWorld();
hw.enterEventDispatcher();
}
}
The debugger would not stop at a breakpoint set on any ine in main(). In HelloWorld() it would not show me the value of 's', saying it was not accessible.
While stopped in HelloWorld() I could not figure out how to move up the call stack, but it may be that I just don't know how to do that in Eclipse (which is also brand new to me).
cunac - thank you for your post about the plugin, as I will give that a try next. Do you have the debugger working fully? Can you view local variables, step in and out of methods (not just step over), and move up the call stack?
Thanks