BlackBerry - use own JAR file in own project

前端 未结 1 1851
旧时难觅i
旧时难觅i 2020-12-01 14:42

(I have solved my problem, so have edited it to look more like a blog post - the final working solution has been placed as an \"answer\" below.)

Aim

I want

相关标签:
1条回答
  • 2020-12-01 15:29

    I have managed to solve the problem so have edited the question, and placed the final procedure, with notes, down here:

    1) Change the SDK project to be a MIDLET application as per this link (Richard Schilling’s Professional Weblog)

    • The BlackBerry support forum has a post (Working with Libraries) erroneously advises the developer to set the project to be an APPLICATION.
    • If you follow those instructions, you may get a signing error requiring the infamous RIMAPPSA2 signature which we are not allowed to sign.

    2) Build the SDK project in Eclipse. Package & Sign the project as normal.

    • This will create a JAR file in the deliverables folder (....deliverables\Standard\5.0.0)

    3) Copy that resulting JAR file into your project, and update the build path to use that JAR.

    • You could probably get working results by just adding it as an external JAR, but I prefer to store the JAR files with my projects for now.

    4) Also in the build path settings, go to the "Order & Export" tab & check the box to export this JAR file.

    WARNING: at this point a lot of users seem to encounter the bug where Eclipse tells you "Project {0} has to have a jad file file if it exports a mildlet jar". This error happens if you do not set the SDK project's type to MIDLET.

    • If you get this error, please check the project's build type.

    • If you have set it to MIDLET correctly, try editing the manifest inside the JAR file, to remove the line MicroEdition-Profile- MIDP-2.0.

    • Full details are given in this link: "Project {0} has to have a jad file file if it exports a mildlet jar" error appears in BlackBerry Java Plug-in for Eclipse

    NOTE: regarding the RIMAPPSA2 signature, I found some info about getting rid of that requirement. The steps seem strange, but they worked for me insofar as the signing stage went. Unfortunately for me the app didn't run on the phone (still requiring some signatures). But these steps might help someone else & can be found at Frustrations with Blackberry Developer plugins for Eclipse

    NOTE 2: remember to refresh your project after reimporting a new build of the JAR file, if you have to go back to step 1 (otherwise Eclipse will keep using the old one you have just overwritten).


    So to summarise:

    1. Build the SDK as a MIDLET.
    2. Package & Sign the SDK.
    3. Import into application project & be sure to check the box to export it in the build path settings.

    If you get questions about RIMAPPSA2 signatures, see step 1.

    Easy when you know how - but this took me many days to get right?!?

    0 讨论(0)
提交回复
热议问题