如何在黑莓中添加当前开发项目的库项目

2022-01-16 00:00:00 eclipse-plugin eclipse blackberry

我是黑莓新手,目前我正在开发一个项目,在该项目中我需要添加一个 jar(Ksoap) 文件.为此,我创建了一个项目,并添加了需要在构建路径上添加的 jar 文件.最后我尝试使用开发项目设置黑莓项目依赖项,我无法获得选择库项目的选项.我参考 http://www.blackberryforums.com/developer-forum/155972-blackberry-ksoap2-tutorial.html 这个网站.

I'm new to blackberry, currently I'm developing a project, in that project I need to add a jar(Ksoap) file. For this I created a project and I added the jar file which I required the added it on build path. Finally I try to set blackberry project dependencies with the development project, I could not able to get option to select library project. I refer http://www.blackberryforums.com/developer-forum/155972-blackberry-ksoap2-tutorial.html this site.

我使用的是 eclipse indigo 3.7 版本.

Im using eclipse indigo 3.7 version.

谁能帮我解决这个问题.

Can anyone help from me out of this.

提前致谢.

推荐答案

我的食谱:

  1. 使用 JDE 中包含的 preverify 工具手动预验证您的 jar(路径为C:Program filesResearch In MotionBlackBerry JDE xxxin",其中 x 是版本号).
  2. 从binoutput"目录中选择preverivied jar.
  3. 复制该文件并粘贴到您的 eclipse 包资源管理器中,位于工作区的根目录,或者(如果您使用的是旧插件)在 src 文件夹中.
  4. Java 构建路径 -> 库选项卡 -> 添加 jar.
  5. 享受,但是...
  1. Manually preverify your jar with the preverify tool included in the JDE (the path is "C:Program filesResearch In MotionBlackBerry JDE x.x.xin", where the x's are version numbers).
  2. Pick the preverivied jar from the "binoutput" directory.
  3. Copy the file and paste in your eclipse package explorer, at the root of the workspace, or (if you are using old plugin) inside the src folder.
  4. Java Build Path -> libraries tab -> add jar.
  5. Enjoy, but...

这将适用于给定的项目.如果你尝试在另一个项目中做同样的事情,你会得到一个 RuntimeException 因为有同名的类(包名冲突).您可以为每个项目重构jar中的包,或者将jar添加到库项目而不是主项目中,以便其他项目可以使用它.

This will work for a given project. If you try to do the same in another project, you'll get a RuntimeException because there are classes with the same name (the package names collide). You can refactor the packages in jar for each project, or add the jar to a library project instead of the main project, so that other projects can use it.

相关文章