Setting up Eclipse and Installing KSoap2 on the BlackBerry
First of all, do yourself a favour. Just download the Full JDE Plugin, it includes Eclipse. I started by installing a vanilla Eclipse and getting the plugins after, it wasn’t worth the hassle for me. I’m using version 1.0.0.67
Now fire it up and let’s start.
- Create a new workspace.

- Create a new BlackBerry Project. File > New > Project Select BlackBerry project named ?Sample?.(Figure 2)
- Create another new BlackBerry Project named ‘KSoapLibrary’ (Figure 3).


- Open the Project Properties for KSoapLibrary. Go the ‘BlackBerry Project Properties’ and click the ‘Application’ tab. From the Project Type drop down select Library (Figure 4). Click OK.

- Now we need to add the KSoapLibrary as a project reference to the Sample project. Go to the Project Properties for Sample, click the Project References and select the KSoapLibrary checkbox (Figure 5). Click OK.

- It’s time to create a class within our Sample project. Select New > Class. Set the class and packages names (Figure 6). Click Finish.

- Add the contents of the HelloWorld.java file found in the Resources section at the bottom of this page to your new class.
- Eclipse will now give you a number of errors in the file (Figure 7). This is because Eclipse does not have the KSoap files within the build classpath. Let’s fix that.

- Create a folder within the KSoapLibrary project named ?lib? and add the ksoap2-j2me-core-prev-2.1.2.jar file to the new folder. The pre-verified ksoap file is VERY important. You can either preverify it yourself ordownload ksoap2-j2me-core-prev-2.1.2.jar now.
- In the Sample project properties. Click on the ?Java Build Path? item, then the ?Libraries? tab. Finally, click ?Add Jars??. Select the KSoap jar, then click OK. Now click on the ?Order and Export? tab and select the KSoap jar and click OK (Figure 8).

- Now your Eclipse Package Explorer should like the screen shot below, and the error will have disappeared (Figure 9).

- Finally, create another folder under your Samples project named ?images? and add an icon to it. Now go to your project properties then ?BlackBerry Project Properties? and add some information to the ?General? tab and add your icon from the ?Resources? tab (Figure 10).

- Done! Now Run it!

Didn’t work?
Common problems may include ?Error Starting Sample: Module ?ksoap2-j2me-core-prev-2.1.2? not found.? I struggled with this for some time. Go back and retrace your steps, you?ve skipped over something. Even though it compiles fine within Eclipse the ksoap jar has not been deployed to the device along with the rest of your code. I have noticed an annoyance where the KSoap jar will be removed from the Properties > Java Build Path ?Libraries? and ?Order and Export? tabs if you make any further changes to the ?BlackBerry Project Properties?. You?ll have to go back in and re-add the jar.
![]()
The next example will build off of this and demonstrate how to connect to a .NET web service.
Resources:
- Source Code for this tutorial
- BacklBerry JDE Eclipse Full Plugin: http://na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp
- BlackBerry Development Tools – Eclipse Plugin (in beta): http://developerlife.com/tutorials/?p=427
- BlackBerry JDE and kSoap and noobs: http://www.blackberryforums.com/developer-forum/140930-blackberry-jde-ksoap-noobs.html
- **** BlackBerry and Ksoap2 Tutorial *****: http://www.blackberryforums.com/developer-forum/155972-blackberry-ksoap2-tutorial.html
- Part 2 of this tutorial