Question

I am trying to get our build machine to consistently build our Blackberry project (build using the Eclipse plugin not the JDE) on check-in. We are using Jenkins to call the project and sometimes it works but only after I've fired up the project in eclipse on the far machine but then restarting causes the error to come back.

The first error I get is (the following errors are all in the same vein):

 [javac] c:\<path_to_project>\src\path\to\package\class.java:6: error: package net.rim.device.api.ui does not exist

And every other reference to a net.rim.* object. Clearly it's because it's not linking to the target net_rim_api.jar file but I can't figure out what on earth is going wrong. I've tried poking at the build.xml file but I just get more errors and other versions of this error in other threads turn out to be not the same thing.

I have tried installing and using BB-Ant (roughly following this tutorial) but it has not provided me with the solution - I'm prepared to admit that I may have made a mistake in the implementation but I followed it as closely as I could with the current project that I have.

I would appreciate any help that you can give me.

EDIT

So I've now altered the project to use <rapc> instead of <javac> which appears to do the linking to the .jar for you but it's still frustrating that you can't simply use the auto generated build.xml. Is this a known (and due to lack of information available on the internet, accepted) issue with Eclipse?

Was it helpful?

Solution

I went down the BB Ant build script road a year or so ago, got a lot of help on this site, and tried to document my progress on this site. Hopefully the links I place will help you and others.

I have marked this as "community wiki" since it doesn't directly answer the question but I do think it is useful.


Basic algorithm

My answer on this page shows the algorithm for a working build script (BlackBerry: create COD from JAR source file in Ant script). Perhaps this is more complicated than you are looking for, but it does show the relationship I found between javac and rapc.

To summarise, I wanted to include my SDK into the final build, and the steps were:

  1. javac the SDK to create CLASS files

  2. preverify the CLASS files

  3. jar the SDK

  4. Copy the SDK JAR file into the project

  5. javac the project - use the SDK JAR as the classpath

  6. preverify the project CLASS files (again, use the SDK JAR in the classpath)

  7. jar the project - add the SDK JAR as a zipfileset

  8. jarjar this project JAR to refactor package names as required

  9. Finally, run rapc on this JAR - it will find no duplicate COD files & should run fine.

Please read the other answers on that page, since they offer great advice that I used in my end result.


Extra Info & Including a JAR into final output

I'd recommend this page just for the extra links that I included in it - the exact question is unrelated (BlackBerry - Ant script to include JAR in project without external dependancies).

Again, the value is in the answers that the other guys provided.


Misc

Here are a couple of links to other BB build script issues that I had - you or someone may find them useful:

Finally this one speaks to a mistake in the documentation when compiling your own code into a library for import into a different project:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top