BlackBerryForums.com : Your Number One BlackBerry Community
     

»Sponsored Links


BlackBerryApps.com Best Sellers



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default Setup up Eclipse for BlackBerry development - 07-03-2008, 10:08 AM

This is yet another post describing how to setup Eclipse for BlackBerry development work. When I was getting started on my BlackBerry project, I must have read a dozen such posts and articles. None of them gave me all that I needed to get everything working. Hopefully this post will do just that.

I do ask that if you find an error, or something does not work, please post the problem, and hopefully the solution.

However first a caveat. Just 2 weeks ago, when I was downloading programs and setting things up, I was downloading the latest versions of the programs that were available at the time. Now, as I write this post, some of the programs have newer versions available. I will write these instructions using the versions I have installed. I hope there won’t be any significant differences with the newer versions.

1. Download and Install
1.1. JDK from http_://java.sun.com/javase/downloads/index.jsp. I have JDK 6 Update 6, which is the current (non-beta) version.

1.2. BlackBerry JDE from http_://na.blackberry.com/eng/developers/downloads/jde.jsp . I have version 4.3.0. As I write this, the latest is 4.5.0. (There is no 4.4.)

1.3. BlackBerry 8820 Simulator. The 4.3.0 JDE came with simulators for the BlackBerry 8120 and 8130. I had a problem with the cursor getting stuck in TextBox fields, in these simulators. So I got the 8820 simulator which does not have this problem. Go to http_://na.blackberry.com/eng/developers/downloads/simulators.jsp and click the link “Download a BlackBerry Device Simulator”. Then in the pull down, select “BlackBerry Device Simulators v4.2.2”.

1.4. Eclipse from http_://www.eclipse.org/downloads/ . I have version 3.3.2. As I write this, the latest is 3.4. Also note that I have the Eclipse Classic package.

1.5. bb-ant-tools from http_://sourceforge.net/project/showfiles.php?group_id=195339. I have version 0.7 which is still the latest version.
2. Other useful downloads
2.1. Mobile File Manager from http_://www.rovemobile.com/products/freeproducts/mfm/features/. This awesome program allows you to view and manage the file system on the BlackBerry, edit files and even setup an FTP from the BlackBerry to a server. I did not use the FTP feature.

2.2. BlackBerry Desktop Manager from https_://www.blackberry.com/Downloads/browseSoftware.do. Some variant of this program comes with the BlackBerry when you buy it. But if you don’t have one, you can get it here. You need this to install programs to a physical BlackBerry. I have a variant from Roxio that also allows me to transfer files between the BlackBerry and the PC.

2.3. Ant from http_://ant.apache.org/. This will let you test Ant scripts if you want to get into writing them. Eclipse also has a built-in Ant interpreter.
3. Eclipse Setup
3.1. Workspace Preferences
3.1.1. Install the JRE with Javadocs. Note that the following steps assume that in your Eclipse workspace, you will only be doing projects for the BlackBerry. Projects for J2SE or other environments will need to be put into a different Eclipse workspace.
3.1.1.1. Click Window > Preferences from the main menu in Eclipse
3.1.1.2. Click Java > Installed JREs
3.1.1.3. Click Add.
3.1.1.4. Fill the fields:
3.1.1.4.1. JRE type = Standard VM
3.1.1.4.2. JRE name = ‘RIM JRE’
3.1.1.4.3. JRE home = path to the JDK (eg. C:\jdk1.6.0_06)
3.1.1.4.4. Default VM Arguments leave blank
3.1.1.5. In the JRE system libraries box, select all of the entries and click Remove.
3.1.1.6. Click Add External JARs and navigate to the lib directory of the BlackBerry JDE (eg. C:\jde\lib).
3.1.1.7. Select the file net_rim_api.jar.
3.1.1.8. Back in the JRE system libraries box, select the new entry for net_rim_api.jar and click Javadoc Location
3.1.1.9. In the Javadoc window, use the Browse button to navigate to the BlackBerry JDE api directory (eg. C:\jde\docs\api). Click OK to close the Javadoc window.
3.1.1.10. Click OK to close the Add JRE window.
3.1.1.11. In the Installed JREs window, check the box next to the new RIM JRE entry.
3.1.1.12. Click on the prior entry in this list (for jre1.6.0_06) and click the Remove button.
3.1.1.13. Click OK to close the Preferences window.
3.1.1.14. I have seen the above settings not take the first time. So go back into Preferences and make sure they took. If not, do them again. I’ve never seen it not take the second time.
3.1.2. Set the JDK Compliance Level – Since the JRE we started with was version 6, the default compliance setting will be 6.0. But the BlackBerry JDE is not at that level.
3.1.2.1. Click Window > Preferences from the main menu in Eclipse
3.1.2.2. Click Java > Compiler
3.1.2.3. Change the ‘Compiler compliance level’ to 1.4.
3.1.2.4. Click OK to close the Preferences window.
3.1.3. Setup a Detail Formatter for the String class.
3.1.3.1. Click Window > Preferences from the main menu in Eclipse
3.1.3.2. Click Java > Debug > Detail Formatters
3.1.3.3. Click Add
3.1.3.4. Fill the fields:
3.1.3.4.1. Qualified type name = java.lang.String
3.1.3.4.2. Detail formatter code snippet = toString()
3.1.3.5. Click OK
3.1.3.6. In the Detail Formatters window, select the ‘In detail pane only’ radio button.
3.1.3.7. Click OK to close the Preferences window.
3.1.4. Setup the formatting styles you like
3.1.4.1. Click Window > Preferences from the main menu in Eclipse
3.1.4.2. Click Java > Code Style > Formatter
3.1.4.3. Click the New button and enter a name. Click OK
3.1.4.4. In the Profile window that pops up, go through the tabs and configure the styles you like.
3.1.4.5. Click OK to close the Profile window
3.1.4.6. Click OK to close the Preferences window.
3.1.5. Increase debugger timeouts
3.1.5.1. Click Window > Preferences from the main menu in Eclipse
3.1.5.2. Click Java > Debug
3.1.5.3. Increase the Lauch timout by a factor of 10 (eg. set to 200000)
3.1.5.4. Increase the Debugger timeout by a factor of 5 (eg. set to 15000)
3.1.5.5. Click OK to close the Preferences window.
3.1.6. Other settings
3.1.6.1. Click Window > Preferences from the main menu in Eclipse
3.1.6.2. Click General > Workspace
3.1.6.3. Uncheck ‘Build automatically’
3.1.6.4. Check ‘Refresh automatically’
3.1.6.5. Check ‘Save automatically before build’
3.1.6.6. Click OK to close the Preferences window
3.2. Project Setup. The default situation for Eclipse is to have the source code for a project located in the directory tree that you specified for the workspace. However I already had the source files located elsewhere. So I needed to setup the project differently.
3.2.1. If you are still looking at the Welcome window, click the Workbench button, located on the far right.
3.2.2. Click File > New > Project from the main menu in Eclipse
3.2.3. Give the project a name
3.2.4. Select ‘Create new project in workspace’. The source files are elsewhere, but the other project files can be in the workspace.
3.2.5. Select ‘Use default JRE (Currently ‘RIM JRE’)’
3.2.6. Select ‘Create separate folders for source and class files’
3.2.7. Click Next
3.2.8. Click ‘Link additional source’.
3.2.8.1. Use the browse button to locate the external source folder.
3.2.8.2. Give this source tree a name (in the Folder name field)
3.2.8.3. Click Next
3.2.8.4. If there are files in that tree that need to be excluded, then add Exclusion patterns. For example, I needed to exclude:
3.2.8.4.1. **/CVS/**
3.2.8.4.2. *.html
3.2.8.4.3. *.txt
3.2.8.5. Click Finish
3.2.9. If you have additional source trees for the project, then in the Java Settings window, click ‘Link additional source’, and repeat the source configuration for each such source tree.
3.2.10. In the New Java Project window select the ‘Order and Export’ tab.
3.2.11. Check the box next to ‘JRE System Library [RIM JRE]’
3.2.12. Click Finish
3.3. Add bb-ant-tools to the project. This library is needed to build your project’s code for the BlackBerry.
3.3.1. In the Eclipse Package viewer, right mouse click on the Project name, and click New > Folder.
3.3.2. Enter the new Folder name as lib. Verify that the parent folder is the project.
3.3.3. Click Finish
3.3.4. In the Package viewer, right mouse on the new lib folder and click Import.
3.3.5. In the Import window, click General > File System.
3.3.6. Click Next
3.3.7. Use the Browse button to locate the directory containing the bb-ant-tools.jar file that you downloaded earlier. Then in the right pane, check the box next to the bb-ant-tools.jar file. Verify that the “Into folder” field is the lib folder.
3.3.8. Click Finish
3.3.9. In the Package viewer expand the lib folder and right mouse on the bb ant tools.jar file. Click Build Path > Add to Build Path.
3.4. Add a build.xml file to the project. This file is the Ant script that will be used to build your project’s code for the BlackBerry.
3.4.1. In the Package viewer, right mouse and click New > File.
3.4.2. Enter the new file name as build.xml. Verify that the parent folder is the project.
3.4.3. Click Finish
3.4.4. Copy the following into the build.xml file.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="AudioTests" default="buildRIM" basedir=".">
	<taskdef resource="bb-ant-defs.xml" classpath="lib/bb-ant-tools.jar" />
	
	<property name="jdehome" value="C:\jde" /> 
	<property name="javahome" value="C:\jdk1.6.0_06"/>
	<property name="simulator" value="${jdehome}\simulator" />
	<property name="bin" value="${jdehome}\bin" />
	
	<property name="output" value="ProjectName" />
	<property name="title" value="Project Title" />
	<property name="vendor" value="company name" />
	<property name="version" value="0.1" />
	<property name="description" value="my BlackBerry program" />
	
	<target name="buildRIM" description="Composes RIM" depends="clean">
		<rapc jdehome="${jdehome}" jdkhome="${javahome}" output="${output}" >
			<jdp title="${title}" vendor="${vendor}"
			 version="${version}" description="${description}"
			 runonstartup="false" type="cldc" />
			<src>
				<fileset dir="C:\srcPath1">
					<include name="**/*.java" />
					<include name="resources/**/*.*" />
				</fileset>
				<fileset dir="srcPath2">
					<include name="**/*.java" />
					<include name="resources/**/*.*" />
				</fileset>
			</src>
		</rapc>
		<copy todir="${simulator}" overwrite="true">
			<fileset dir=".">
				<include name="*.cod" />
				<include name="*.debug" />
				<include name="*.cso" />
			</fileset>
		</copy>
	</target>
	
	<target name="clean">
		<delete>
			<fileset dir="bin" includes="**/*.class"/>
			<fileset dir=".">
				<include name="*.cod"/>
				<include name="*.cso"/>
				<include name="*.debug"/>
				<include name="*.jad"/>
				<include name="*.jar"/>
				<include name="*.rapc"/>
			</fileset>
		</delete>
	</target>
	
</project>
3.4.5. Edit the property values at the top of this file, and also adjust the fileset directory paths in the BuildRIM target, for the source trees in your project.
3.4.6. Save and close the editor for the build.xml file.
3.5. Setup custom builders. These tell Eclipse to run the Ant script in build.xml when you build or clean the project.
3.5.1. In the Package viewer, right mouse on the project name and click Properties.
3.5.2. Click Builders
3.5.3. Click New
3.5.4. Click Ant Builder
3.5.5. Click OK
3.5.6. Change the name of the new builder to RIM_Builder.
3.5.7. On the Main tab, under the Buildfile text field, click the Browse Workspace button.
3.5.8. Select build.xml and click OK
3.5.9. On the Targets tab, click the ‘Set Targets’ button to the right of the ‘During a “Clean”’ field.
3.5.10. Uncheck the box next to the ‘buildRIM’ target and check the box next to the ‘clean’ target.
3.5.11. Click OK
3.5.12. Click OK again to close the new builder properties window.
3.5.13. In the Builders window, click on the new builder (RIM_Builder) and click the Up button, moving the new builder to the top of the list.
3.5.14. Click the OK button closing the Builders window.
3.6. Start and setup the JDWP debugger interface. Assuming you have a project with some source code that has successfully built, the next steps will get the project into the simulator and ready for debugging. One of the applications that was installed with the RIM JDE is JDWP.
3.6.1. Start JDWP
3.6.2. On the Simulator tab, Verify that the Profile selected matches the simulator to be used. If not, click the New button.
3.6.3. On the Advanced tab, use the Browse button to navigate to the simulator’s directory (the model number.bat file must be in this directory – eg. 8820.bat).
3.6.4. Click the Edit button and set the command line to

Code:
F:\Java\BlackBerryJDE\simulator\fledge.exe
/app-param=JvmAlxConfigFile:8820.xml
/pin=0x2100000A
/data-port=0x4d44
/data-port=0x4d4e
/app-param=DisableRegistration
/app=Jvm.dll
/keep-lcd-on=true
/handheld=8820
/session=8820
3.6.5. On the General tab, check ‘Launch simulator when debugger connects’.
3.6.6. Click the Launch Simulator button and wait for the simulator to start.
3.6.7. Exit from the simulator (File > Exit) but do not exit the JDWP debugger interface.
3.7. Setup an Eclipse debugger configuration.
3.7.1. In the Eclipse Package viewer, right mouse on the project and click Debug As > Open Debug Dialog.
3.7.2. Right mouse on Remote Java Application, and click New.
3.7.3. Give the configuration a name, such as BB_Debugger.
3.7.4. Click the Debug button.
3.7.5. Eclipse will build the project and will then connect to JDWP, which will start the simulator.
3.7.6. As the simulator starts, have the JDWP window raised to the top on your screen. This will let you see any pop ups from JDWP that say the simulator can not find a file. If such pop ups occur, it is typically safe to click the “Don’t ask this again” button. So long as JDWP is running, it will not ask about that file again.
3.7.7. Close the simulator
3.8. Starting the simulator/debugger. After the debugger configuration has been created, as described above, the debugger can be started as follows:
3.8.1. Locate the toolbar button whose tool tip is “Debug As…”.
3.8.2. Click the pull down arrow located on the right of that button.
3.8.3. At the top of the list will be the Debugger configuration created above (BB_Debugger). Click that item in the list to run that configuration.
That pretty much does it for setting up Eclipse for BlackBerry development. I do however have some other tips that I’ve learned.

BlackBerry Tips

1. Remove unwanted applications from the simulator. In the Simulator directory (eg. C:\jde\simulator) is a file called 8820.xml (assuming you are looking at the 8820 simulator). Remove from this file the lines that specify applications you don’t care to have loaded in the simulator. This will remove clutter from the simulator’s main menu. It may also speed up loading of the simulator, but not by much.

2. Remove your projects from the simulator. Both of the following steps must be done.
2.1. In the simulator directory (eg. C:\jde\simulator), there are 3 files for each of your projects. Delete all 3 of them. They are:
2.1.1. projectName.cod
2.1.2. projectName.cso
2.1.3. projectName.debug
2.2. Run the simulator
2.2.1. Select the Options icon
2.2.2. Select Advanced Options
2.2.3. Select Applications
2.2.4. Click the menu button (the Insert key on the PC keyboard)
2.2.5. Select Modules
2.2.6. Scroll through the list to find your project
2.2.7. Click the menu button (Insert key)
2.2.8. Select Delete
3. Prevent the simulator’s display from going black.
3.1. In the simulator window, select View > Keep LCD On. This will affect only the current simulator session
3.2. In the JDWP window, on the Simulator tab > View tab, check ‘Always keep LCD backlight on’.
4. Installing your project to a physical BlackBerry
4.1. Connect your BlackBerry to your PC with the USB cable.
4.1.1. I get a pop up on the BlackBerry when I connect it to the PC, asking if I want to enable Mass Storage Mode. No matter what I answer (yes or no) the connection to the PC gets broken. So I just don’t answer the pop up until after I’m finished with the connection. After removing the USB cable the pop up goes away on its own.
4.2. On your PC, locate the cod file for your project. It will be in the Eclipse project directory, which is typically under the Workspace directory.
4.3. Open a cmd window in that directory and run the following command. (javaloader comes with RIM’s JDE).
Code:
javaloader -usb load projectName.cod
5. Removing your project from a physical BlackBerry
5.1. Connect your BlackBerry to your PC with the USB cable.
5.2. Open a cmd window in that directory and run the following command. (javaloader comes with RIM’s JDE).
Code:
javaloader -usb erase -f projectName.cod
6. Edit files and navigate the file system on the BlackBerry (physical or simulator).
6.1. Install the Mobile File Manager program to the simulator and/or the physical BlackBerry. Use the BlackBerry Desktop Manager to install this program.
6.2. Programs installed with the BlackBerry Desktop Manager are also removed using the BlackBerry Desktop Manager.
7. In Eclipse, name your project with a letter less than ‘n’. When removing your project from the simulator, the modules list has tons of RIM modules that start with “net_rim”. You want your module before that long list of RIM modules.

8. Locate the PIN or IMEI numbers in a physical BlackBerry. Open Options > Status.

Eclipse Tips

1. Automatically add an import statement for an unknown type. Place cursor on the unknown type and hit Ctrl-Shift-m.
2. Organize the import statements – hit Ctrl-Shift-o
3. Have only one main() in your entire project; otherwise when you try to start the project in the simulator, it may not run the desired main(). The simulator will give no indication of why it seems that your program is not starting.

RIMs BlackBerry JDE Plug-In for Eclipse

I downloaded version 1.0.0.22 (the latest) of this plug-in. In a word, don't bother. According to RIM support, it only works with version 3.3.1 of Eclipse, so it would not work with the 3.3.2 version that I have. It also will not work on Windows 2000 (which I also use).

Improvements Needed to the above Instructions

• It would be really nice if only changed java files were recompiled. My project currently has over 200 files and will have over 300 when finished.
• It would be nice to have a way to specify the class containing the desired main() to be run.

Acknowledgements

My thanks to the many authors whose posts and articles and answers to my questions have helped me get this far. I'm sure you see your work in the above. Thank you.
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
shraddha294 Offline
Thumbs Must Hurt
 
shraddha294's Avatar
 
Posts: 111
Join Date: Oct 2007
Location: Hyderabad
Model: 8800
PIN: N/A
Carrier: TMobile
Default 07-08-2008, 02:06 AM

Great Job Paul!!
Thanks...
this will be a lot of help to most of us on the forum!
   
Reply With Quote
  (#3 (permalink)) Old
skynetchris Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Default 07-08-2008, 02:23 AM

I dont understand what the benefits of using eclipse are? The IDE that blackberry distribute is excellent and provides everything you need? Why use eclipse?
   
Reply With Quote
  (#4 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 834
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Default 07-08-2008, 04:27 AM

Quote:
Originally Posted by skynetchris View Post
I dont understand what the benefits of using eclipse are? The IDE that blackberry distribute is excellent and provides everything you need? Why use eclipse?
i really hope you are kidding.

@plevintampabay: most excellent post. vote for sticky!


java developer, Devinto, hamburg/germany
   
Reply With Quote
  (#5 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default 07-08-2008, 08:20 AM

Skynetchris -- just in case you are not kidding -- Yes the JDE gives you everything you need, if your program is one or two files. Actually I did a test program with about 5 files (5 classes) and everything went well.

Using the debugger in the JDE is actually better (faster, more responsive and no strange things happening) than using the debugger from Eclipse. But my program has over 200 files right now. The JDE is totally unusable at that size.

You can't find all references to a variable, method, or class. You can't do effective searches. The JDE does have limited completion (pops up the methods in a class) but nothing like the features in the Eclipse. Try writing code in Eclipse for a while and you'll never go back to the JDE.

To be fair, I have not tried the latest JDE. Maybe it has tons of new features. I'll have to take a look at it, at some point. Of course Eclipse also has a newer version out too.
   
Reply With Quote
  (#6 (permalink)) Old
pa4o85 Offline
Thumbs Must Hurt
 
Posts: 150
Join Date: May 2007
Location: Bulgaria
Model: none
PIN: N/A
Carrier: Mtel
Default 07-08-2008, 08:34 AM

I agree with you. Eclipse is much better but I have a problem with Eclipse that never succeed to resolve. I cannot debug in Eclipse. I made everything that has been written up there. I launch the simulator through Eclipse using JDWP, the simulator is running but the application is not started. I need to go to start it by myself and then there are no debug variables, the breakpoints are not working. The only way I can "debug" (it is not debuging exactly) is to put message on the JDWP console (output) using System.out stream. Has anyone had this problem ?
   
Reply With Quote
  (#7 (permalink)) Old
New Member
 
Posts: 1
Join Date: Jul 2008
Model: 88000
PIN: N/A
Carrier: test
Default 07-08-2008, 12:38 PM

C:\EclipseBlackBerry\D2LBlackberryClient\build.xml :3: java.lang.UnsupportedClassVersionError: ca/slashdev/bb/RapcTask (Unsupported major.minor version 49.0).

Could somebody tell me how to fix it?
   
Reply With Quote
  (#8 (permalink)) Old
skynetchris Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Default 07-08-2008, 06:52 PM

I'm not kidding, and I still dont see any 'advantages' to using Eclipse. Yes its opensource, yes its pretty, yes its good at what its MEANT to do.

So here the positives of installing the BB IDE:
- One install, no setup required
- Runs debugger
- Runs multiple simulators
- Runs internal calsses (as reccomended by Sun and BB to increase performance, so why -have 200 files?) perfectly fine.
- Can atattch to a device and debug on the device
- Can break point an application at runtime wherever you chose dynamically, just like iphone.

Negatives:
Large projects? (I haven't encountered this and my application is quite large [1500+ lines, 4 threads]).

I did try using Eclipse and its nice, if your doing plain java or something thats not device specific. Anyway, lets keep this fairly factual.

Positives of Eclipse:
*your points here*

Negatives:
- requires a 5 page setup
- doesn't have the same level of debugging/choices
- Doesn't do on device debugging
   
Reply With Quote
  (#9 (permalink)) Old
d_fisher Offline
Retired BlackBerryForums.com Moderator
 
d_fisher's Avatar
 
Posts: 4,452
Join Date: Oct 2005
Location: Columbus, OH
Model: 8100
OS: SID 6.7
PIN: KS All Out
Carrier: T-Mobile
Default 07-08-2008, 08:44 PM

Execellent post! Thread is now a sticky.


Doug

Remember, please try searching first!

Need a screenshot? ... Like JavaLoader?
Try using BBscreen .....Use JL_Cmder!
or BBScreenShooter!

   
Reply With Quote
  (#10 (permalink)) Old
yairw Offline
New Member
 
Posts: 14
Join Date: Jun 2008
Model: 8300
PIN: N/A
Carrier: vodafone
Default 07-11-2008, 03:35 AM

Thanks for the great post, it helped were the eclipse plugin completely fails.
I have question with build.xml. I have a few library jar files that I use. I added them to the RAPC task using the <import> element <import location="/workspace/BlackBerry/MobileBlackBerry/lib/MathEvaluator.jar" />. Everything works fine until I run the application. I get the following exception "Entry point not found for Module MathEvaluator". Any idea what I need to do to get my app to rapc and run.
   
Reply With Quote
  (#11 (permalink)) Old
MrCmonster Offline
New Member
 
MrCmonster's Avatar
 
Posts: 12
Join Date: Jan 2008
Location: Southern Colorado, USA
Model: 8310
PIN: N/A
Carrier: AT&T
Default 07-12-2008, 01:32 PM

Thanks for helping out with such an informative post!


--
When in doubt, pull the battery out.
   
Reply With Quote
  (#12 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default 07-12-2008, 03:12 PM

Just a quick note to all of the people with questions of why your situation doesn't work -- I'm a realtive beginner here too, so I don't know the answers to your questions. Hopefully others might.
   
Reply With Quote
  (#13 (permalink)) Old
pwaugh Offline
Knows Where the Search Button Is
 
Posts: 40
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Default 07-17-2008, 02:38 AM

@plevintampabay: Great post! Helped get me up and running with Eclipse in no time.

Finally, to the person wondering why use Eclipse, if you don't know, it is because you don't yet know enough to know you need it. =) And inner classes are great when used where they are indicated/required, but are not a substitute for proper OO design and coding. Just wait till 2 years from now you need to go back and modify your 1500+ line file with multiple sub-classes. Good luck with that! We'd never have a file that big in our shop, and we've written a couple 80,000+ line avionics projects! Knocking Eclipse because it requires a setup is like saying an abacus is better than a computer because you don't have to turn it on!

Last edited by pwaugh : 07-17-2008 at 02:48 AM.
   
Reply With Quote
  (#14 (permalink)) Old
skynetchris Offline
Knows Where the Search Button Is
 
Posts: 24
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Default 07-24-2008, 02:01 AM

Quote:
Originally Posted by pwaugh View Post
@plevintampabay: Great post! Helped get me up and running with Eclipse in no time.

Finally, to the person wondering why use Eclipse, if you don't know, it is because you don't yet know enough to know you need it. =) And inner classes are great when used where they are indicated/required, but are not a substitute for proper OO design and coding. Just wait till 2 years from now you need to go back and modify your 1500+ line file with multiple sub-classes. Good luck with that! We'd never have a file that big in our shop, and we've written a couple 80,000+ line avionics projects! Knocking Eclipse because it requires a setup is like saying an abacus is better than a computer because you don't have to turn it on!
Lots of metaphors and no facts.

I do use eclipse, not for BB development.
   
Reply With Quote
  (#15 (permalink)) Old
pwaugh Offline
Knows Where the Search Button Is
 
Posts: 40
Join Date: Mar 2008
Model: 8820
PIN: N/A
Carrier: at&t
Default 07-24-2008, 02:04 PM

Those who want even more detail, and a slightly different way of setting up Ganymede, register and login to our Wiki: Main Page - BerrysoftWiki

Over the next few days I'll be adding even more info on the setup, including how to really tweek your build.xml file. Might do an article on it on our Blog: Berrysoft Developer.
   
Reply With Quote
  (#16 (permalink)) Old
nyte3k Offline
Thumbs Must Hurt
 
nyte3k's Avatar
 
Posts: 62
Join Date: May 2008
Model: 8320
PIN: N/A
Carrier: Tmobile
Default 09-06-2008, 02:14 PM

I got everything working, but i did notice that eclipse underlines references to classes in my project as an error, basically saying it cannot find that import class. Even thought it compiles and runs.

Anyone else have this issue? It's just ugly seeing a ton of errors in your project, especially when they don't exist.

I'm on Eclipse Ganymede btw
   
Reply With Quote
  (#17 (permalink)) Old
rafreire Offline
New Member
 
Posts: 1
Join Date: Sep 2008
Model: 8130
PIN: N/A
Carrier: Oi Brasil
Default 09-26-2008, 11:31 PM

Hi, I´m new to the BlackBerry development , I have a question. I don´t see the package named "files" (there are images and music in it) in the jar file the ant creates before de .cod file. Thanks
   
Reply With Quote
  (#18 (permalink)) Old
SirCharlesZA Offline
New Member
 
Posts: 11
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: Vodacom
Default 10-21-2008, 04:21 AM

Hi there.

Also new to BlackBerry development. Have the following error, anyone know what causes this or how to fix it?

Unable to start simulator. Check that the file exists.(java.io.IOException: Cannot run program "C:\RIM\BlackBerryJDE4.3.0\simulator\fledge.ex e/xxxxx" (in directory "C:\RIM\BlackBerryJDE4.3.0\simulator\"): CreateProcess error=3, The system cannot find the path specified)

Think it has something to do with the Command Line or Workign Directory setup.

Thanks
   
Reply With Quote
  (#19 (permalink)) Old
shooirn Offline
New Member
 
shooirn's Avatar
 
Posts: 6
Join Date: Dec 2006
Location: China
Model: 8100T
Carrier: CMCC
Default 11-25-2008, 11:29 AM

Thanks for share !
Nice post!


One comes up must go down!
   
Reply With Quote
  (#20 (permalink)) Old
pradipks Offline
New Member
 
Posts: 3
Join Date: Nov 2008
Model: 8310
PIN: N/A
Carrier: Vodafone
Default 11-25-2008, 05:19 PM

Hi All:

I am new in BB project with eclipse.

We are planing to keep our BlackBerry project in subversion [.classpath, .project and .jdp file] so that any developer can acquire the source and project
from subversion and then bring up the BB Eclipse and import the existing Blackberry project into eclipse. Our BB project have below structure:

BBPROJECT
-src [source have our all source code]
-test [ test have sample example program to test]


But looks like File->import -> Blackberry -> Black Berry JDE Project doesn't seems to be working what we want. When we import it is creating

BBPROJECT
-src [putting the test example sample here]
-src1[ putting the source here]

instead of src and test under BBPROJECT.

Anyone please have experience on this please let me know....


Thanks in advance!!
Pradip
   
Reply With Quote
  (#21 (permalink)) Old
jwywong Offline
New Member
 
Posts: 1
Join Date: Oct 2008
Location: Canada
Model: 8300
PIN: N/A
Carrier: BT
Default To export imported library jars to output cod using Ant script, bb-ant-tools.jar - 12-05-2008, 11:00 AM

Quote:
Originally Posted by yairw View Post
Thanks for the great post, it helped were the eclipse plugin completely fails.
I have question with build.xml. I have a few library jar files that I use. I added them to the RAPC task using the <import> element <import location="/workspace/BlackBerry/MobileBlackBerry/lib/MathEvaluator.jar" />. Everything works fine until I run the application. I get the following exception "Entry point not found for Module MathEvaluator". Any idea what I need to do to get my app to rapc and run.
You might want to try using Ant script with bb-ant-tools.jar

- To export an external library jar (e.g. kxml2-min-2.3.0.jar) to the output BlackBerry cod, add the jar using <include>

- To set up a dependent library (e.g. the jar of the AppResource.cod, which is set as a BlackBerry Lilbrary) to the output BlackBerry cod (cldc), add it using <import>

See below for an example usage:

<target...>
<rapc ...>
<jdp ...>
<src>
<fileset...>
<include name="src/**/*.java"/>
<include name="lib/kxml2-min-2.3.0-preverified.jar"/> </fileset>
</src>
<import location=${dependent.library.bb.cod}.jar" />
</rapc>
</target>

However, I believe that the BB Eclipse plugin as of now is unable to build properly to include an external jar (first case above), see the post in BlackBerry Support Community Forums, thread "Adding External Jars using eclipse" for details.

Hope this helps!
   
Reply With Quote
  (#22 (permalink)) Old
cortecds Offline
New Member
 
Posts: 1
Join Date: Jun 2008
Model: curve
PIN: N/A
Carrier: verizon
Default 01-20-2009, 12:27 AM

These instructions don't work.
This link doesn't work:
http_//na.blackberry.com/eng/developers/downloads/jde.jsp

when I added the JAR files in step 3.1.1.6. I get the error message:
The selected JRE does not support ... compiler compliance level of 1.6
   
Reply With Quote
  (#23 (permalink)) Old
erenken Offline
New Member
 
Posts: 1
Join Date: May 2005
Model: 7100G
Carrier: AT&T
Default Hot to Stop Debugging - 01-26-2009, 12:36 PM

I have Eclipse working, but my big problem is that once it connects to the simulator in debugging mode I can't get it to disconnect. What this means is that when I change my application and want to debug it again I can't. The simulator is always running the first version it had when it started. The only way I have been able to rerun the program is exit Eclipse and restart it.

Anyone have any ideas. I am new to Eclipse, so this may just be something I am missing. I have tried to exit the simulator but that doesn't do anything. It just stays up and I can't stop it.

Thanks for any help.
   
Reply With Quote
  (#24 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default updates to the original article - 02-06-2009, 05:29 PM

Its been 7 months since I've touched the BlackBerry. I'm back on that project, but I might get pulled off again in a week (hopefully only for a month).

I'm also on a new computer, so I had to set everything up again. I am so happy I wrote this article. I knew, when I did, that I would need it to get setup again.

But alas, RIM has removed web pages and made other changes.

1) Following the article, the first thing I discovered is that the latest JDK from Sun is JDK SE 1.6.0 update 12.

2) RIM's latest JDE is 4.7, which can be found at http_://na.blackberry.com/eng/developers/javaappdev/javadevenv.jsp

3) RIM also has new versions of their Eclipse plugin, but I still can not get it to work. If you go to the web page for the JDE, on the left is a button to get the Eclipse plugin. On that page is a button to Download the plug, which gives you the plugin for JDE 4.5 (at least 7 months old), which we knew back then, didn't work. If you scroll down you will find downloads for several versions of the plugin. The first time I downloaded the version for 4.7, WinZip said the zip was corrupted. The second time I downloaded it, WinZip said that one of the jar files in it, had a bad CRC. So much for trying RIMs plugin for Eclipse.

4) There is a new version of bb-ant-tools (v 1.0.2). It is at the same url as before.

5) Finally I got the latest Eclipse - JEE 3.4.1

I still need to use the simulator for 8820 (that is the device I'm targeting, not the 9500 or 9530, whose simulators come with the 4.7 JDE). Luckily I still had the installer for it, which I can no longer find at RIM.

It was not easy to get the new JDWP to work with the 8820 simulator. What I finally got working is this -
a) install the 4.7 JDE
b) rename the JDE/simulator directory to simulator_9500
c) install the 8820 simulator to the directory JDE/simulator.
d) modify the simulator invocation command as per my original post above.

There were several other minor changes (names of menu items or buttons that have been changed) in Eclipse and the JDWP, but they are all minor and easy to resolve.

This is what I've re-learned so far. I'll post what ever else I discover, when I do.

Its very disappointing to see that RIM's tools are as difficult to deal with now, as they were 7 months ago. I guess they are trying to keep the population of developers to a minimum.

Last edited by plevintampabay : 02-06-2009 at 05:32 PM.
   
Reply With Quote
  (#25 (permalink)) Old
koic Offline
Thumbs Must Hurt
 
Posts: 62
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Default 02-18-2009, 02:13 PM

Quote:
Originally Posted by plevintampabay View Post
... which I can no longer find at RIM..
All previous versions of devices are still in the previos versions of plug-in packs.
For example, pack 4.5.0.14 contains simulators up to 8830.
Just install right plug-in pack
http_//na.blackberry.com/eng/developers/javaappdev/javaeclipseplug.jsp

Last edited by koic : 02-19-2009 at 10:20 AM.
   
Reply With Quote
  (#26 (permalink)) Old
mafian911 Offline
New Member
 
Posts: 1
Join Date: Mar 2009
Model: 7100T
PIN: N/A
Carrier: Sprint
Default 03-22-2009, 01:08 AM

Hey guys,

So I set this all up just fine, and everything works. One thing I noticed tho... I can't use basic Java primitives like String and Object. Any idea why this is?? I am a seasoned developer, but new to blackberry.
   
Reply With Quote
  (#27 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default 03-22-2009, 03:13 PM

mafian911 - I don't know why you are having problems with String and Object.

But I should mention to folks that I am now using BB's 1.0 plugin for Eclipse. For the most part it has been working well. It has a few problems (can't link to other source directories). At this point I would recommend that people use the plugin rather than all of the above.

By the way I could not get Eclipse to automatically get the plugin from BB. I had to download a zip file and install from it.
   
Reply With Quote
  (#28 (permalink)) Old
AmitG Offline
New Member
 
Posts: 2
Join Date: Feb 2009
Model: 8100
PIN: N/A
Carrier: T-mobile
Default Using BlackBerry>Erase Simulator Files> Erase All ,fails the debug and run operations - 04-13-2009, 09:02 AM

Hi all, I am using the Eclipse plugin for BlackBerry 4.5.
All was working well the app was building and running and the debugger was also working fine until i used this option:
BlackBerry>Erase Simulator Files> Erase All

Now, when i run the app, the app icon does not show up, the debug option is also not working .
when i made another project in the same workspace with a different name, the project executes on RUN, and icon is present on the simulator, but the debugger is not working ,the break points are set but execution does not halt there.
i guess some config files might have been deleted, i am in a fx and not able to find a solution other then reinstalling the plugin again.

guys please help
   
Reply With Quote
  (#29 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default very limited plugin support - 04-13-2009, 10:03 AM

AmitG,
You could try posting your problem on the BlackBerry forums. There is a BB employee who "may" respond in a few days. I have found other annoying issues with the plugin, and I find their support to be present but minimal.
Paul
   
Reply With Quote
  (#30 (permalink)) Old
nihoo.m Offline
New Member
 
Posts: 12
Join Date: Apr 2009
Model: 9530
PIN: N/A
Carrier: no
Default 04-19-2009, 12:49 PM

thanks
   
Reply With Quote
  (#31 (permalink)) Old
liza Offline
New Member
 
Posts: 8
Join Date: Jan 2008
Model: 8800
PIN: N/A
Carrier: asdf
Default Cannot install Blackberry plugin for Eclipse 3.4.2 - 07-07-2009, 04:41 AM

Hi I have installed Eclipse 3.4.2. But i am the following error while installing the Blackberry plug-in.
An error occurred while collecting items to be installed
An error occurred while collecting items to be installed
Error closing the output stream for
Problems downloading artifact: osgi.bundle,net.rim.eide,1.0.0.67.
Exception connecting to .blackberry.com/Download.
Unconnected sockets not implemented
Exception connecting to blackberry.com/.
Unconnected sockets not implemented
Problems downloading artifact: osgi.bundle,net.rim.eide.bootstrapper,1.0.0.67.
Exception connecting to .
Unconnected sockets not implemented
Exception connecting to blackberry.com/
Unconnected sockets not implemented
Problems downloading artifact: osgi.bundle,net.rim.eide.doc,1.0.0.67.
Exception connecting to /





Please tell me what to do
   
Reply With Quote
  (#32 (permalink)) Old
plevintampabay Offline
Thumbs Must Hurt
 
Posts: 58
Join Date: Jun 2008
Model: 8820
PIN: N/A
Carrier: AT&T
Default 07-07-2009, 09:54 AM

Wow - I had hoped they would have fixed that by now. You could try downloading the plugin files directly from the RIM web site. However even there, many people have had problems downloading their zip files. I know of no solution except to keep trying.
   
Reply With Quote
  (#33 (permalink)) Old
kittuseo Offline
New Member
 
Posts: 1
Join Date: Jul 2009
Model: 7100
PIN: N/A
Carrier: development job
Arrow affordable web services - 07-09-2009, 02:50 AM

I do ask that if you find an error, or something does not work, please post the problem, and hopefully the solution.










www[dot]seoguruonline[dot]com
   
Reply With Quote
  (#34 (permalink)) Old
nirmalsat Offline
Knows Where the Search Button Is
 
Posts: 16
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: Vodafone
Default Source not found - 09-29-2009, 04:22 AM

Hi,
I have installed eclipse with all the settings and configurations that u mentioned in versions 3.4.0, 3.4.1 and 3.4.2 with blackberry plugin version 1.0.0.6.7 . When i debug and after a break point has hit when i try to step ( with F5) Eclipse throws an error saying " Source not Found" ..

Could anyone help me out with this..
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2009 BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.