黑莓手机 - 使用自己的工程自己的JAR文件 [英] BlackBerry - use own JAR file in own project

查看:285
本文介绍了黑莓手机 - 使用自己的工程自己的JAR文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我解决我的问题,所以已经编辑它看起来更像是一个博客帖子 - 最后的工作液已被放置为下面的答案)

(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.)

我要打包我们的BB库(V4.5或V5.0)成JAR格式,所以我们可以给应用程序的源$ C ​​$ C到客户端,而给库源$ C ​​$ C。

I want to package our BB libraries (v4.5 OR v5.0) into JAR format, so we can give application source code to clients WITHOUT giving library source code.

目前,我有我的SDK,和我的应用程序,所有的设置与源$ C ​​$ C,如在同一个工作区的不同项目。所有项目编译。我的SDK是设置为一个库项目,我的应用程序为应用程序。

Currently, I have my SDK, and my apps, all setup with source code, as different projects in the same workspace. All projects compile. My SDK is setup as a library project, my apps as applications.

在每个应用程序,我的SDK项目添加到构建路径。

In each app, I add the SDK project to the build path.

Eclipse的处理构建完美,创造了各种各样的COD文件。我复制和放大器;解压缩文件的COD到同一个文件夹,运行 updatejad 来的JAD文件相结合,并与安装完美的许多COD文件结束。

Eclipse handles the build perfectly, creates the various COD files. I copy & unzip the COD files into the same folder, run updatejad to combine the JAD files, and end up with many COD files that install perfectly.

问题是 - 库需要在源$ C ​​$ C

Problem is - the library is required to be in source code.

有信息在这个许多相互矛盾的来源。这个过程是简单的,但没有很好的记载。在一些尝试,我也遇到了以下问题:

There are many conflicting sources of information on this. The process is simple, but not well documented. In some attempts, I have encountered the following problems:


  1. 的JAR文件需要preverification(也许在未来的另一个COM prehensive后一个主题)

  2. 的JAR文件需要的RIMAPPSA2秘密,从签名工具签名

  3. 最终建应用程序被视为没有签署尽管签名工具确认成功

  4. 最终建应用程序没有找到SDK code(JAR文件没有导出在构建路径设置)

不幸的是,这似乎是从RIM引用的主要文件是不正确 - 下面详细介绍

Unfortunately the main document that seems to be referenced from RIM is incorrect - details below.

(我希望它能够交叉参照链接下面一长串这个问题好吗?)

(I hope its OK to cross-reference this question with the following long list of links?)

计算器链接:

  • Blackberry: Verificattion error when using Library project as External Jar
  • How to use External library jar file in Blackberry
  • Blackberry 5.0 - Add reference to a Java Library Project
  • How to add external jar or zip file in the Blackberry project
  • Blackberry Apps - Importing a code-signed jar into an application project
  • How to add library project with the current development project in blackberry

这人给其他环节 - 非常有用:

This one gives other links - quite useful:

  • Handling dependencies in blackberry development

这些不是那么有用:

  • In Blackberry, can we create common library that can be used by different applications?
  • BlackBerry Facebook SDK jar file
  • Adding and Testing Compatibility of External Jar to Blackberry Project
  • How to attach Jar in Blackberry
  • BlackBerry RIMAPPSA2 signing key required -- why?
  • Is there a list of classes, methods and API which will trigger RIMAPPSA2 permission when signing Blackberry application?

RIM:

推荐答案

我已成功地解决这样已经编辑了问题的问题,并置于最后程序,与笔记,到这里:

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

1)改变SDK项目是一个 MIDLET 应用程序按照此链接(<一个href=\"http://rschilling.word$p$pss.com/mobile-development/blackberry/blackberry-java-development-environment-jde\"相对=nofollow>理查德·席林的博客专业)

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


  • 黑莓技术支持论坛有一个帖子(<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/Working-with-Libraries-shared-bundled-releasing-and-using-3rd/ta-p/1391563\"相对=nofollow>与图书馆工作)错误地建议开发人员设置项目是一个应用程序。

  • 如果您按照这些指示,你可能会得到一个错误签名要求,我们是不允许签署了臭名昭著的RIMAPPSA2签名。

  • 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)建立在Eclipse SDK的项目。包装及放大器;签署项目为正常。

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


  • 这将创建交付文件夹中的JAR文件(....交付\\标准\\ 5.0.0)

3)复制生成的JAR文件到您的项目,并更新构建路径使用该JAR。

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


  • 您很可能获得通过只是将其添加为外部JAR工作的结果,但我preFER与我的项目中的JAR文件存储了。

4)另外,在构建路径设置,进入订单&安培;导出选项卡和放大器;勾选导出这个JAR文件。

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

警告:在这一点上很多用户似乎遇到臭虫Eclipse的告诉你项目{0}必须有一个jad文件文件,如果导出一个mildlet罐子。如果不设置SDK项目的类型MIDLET发生此错误。

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.

如果您有它正确设置为MIDLET,尝试编辑清单中的JAR文件中,以删除行 MicroEdition-简介 - MIDP-2.0

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.

全部细节给出了此链接:<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/quot-Project-0-has-to-have-a-jad-file-file-if-it-exports-a/ta-p/502501\"相对=nofollow>项目{0}必须有一个jad文件文件,如果导出一个mildlet罐子出现在黑莓Java错误插件为Eclipse

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

注意:有关RIMAPPSA2签名,我发现了大约摆脱这一要求的一些信息。这些步骤看起来很奇怪,但他们的工作对我来说,只要签约阶段了。不幸的是,我的应用程序没有在手机上运行(需要还是有些签名)。但是,这些步骤可能帮助别人和放大器;可以在与黑莓开发者的插件挫折为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

注2:记住重新导入JAR文件的新版本后,刷新你的项目,如果你不得不回到步骤1(否则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).

总结一下:


  1. 构建SDK作为一个MIDlet。

  2. 包装放大器;签署SDK。

  3. 导入到应用程序项目和放大器;一定要检查一下方块,出口在构建路径设置。

如果你得到一个关于RIMAPPSA2签名的问题,请参阅步骤1。

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

容易当你知道如何 - 但是这花了我很多天才能正确

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

这篇关于黑莓手机 - 使用自己的工程自己的JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆