在 Eclipse 中导入现有源代码作为引用库

发布于 2024-10-09 07:48:00 字数 288 浏览 3 评论 0原文

我有一些来自朋友的源代码,我想将其用作我的 BlackBerry 项目中的参考库。我不确定如何将源代码打包到 .jar 文件中。我尝试将源导出到 JAR 文件并将其作为外部 JAR 导入到我的项目中,这给了我丢失堆栈映射错误。我尝试使用 BlackBerry JDE 提供的预验证工具来预验证从源生成的 .jar 文件,但它没有给我任何输出文件夹。

事实上,我不确定我导出源的方式是否正确。谁能提供有关如何将现有源代码打包到有效 JAR 文件中的分步说明,该文件可以作为引用库导入到我的项目中?

再次,我正在使用 Eclipse。

I have some source codes from a friend that I would like to use as referenced library in my BlackBerry project. I'm not sure about how to package the source codes into a .jar file. I tried exporting the source to a JAR file and import it as external JAR in my project, it's giving me missing stack map error. I tried to preverify the .jar file generated from the source using the provided preverification tool from BlackBerry JDE, it didn't give me any output folder.

In fact, I'm not sure if the way I export the source is correct. Can anyone provide step-by-step instructions on how to package existing source code into a valid JAR file that can be imported into my project as a referenced library?

Again, I'm using eclipse.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洒一地阳光 2024-10-16 07:48:00

我为这个问题奋斗了几个月...

我为您提供了两种解决方案:

A-如果您计划在多个应用程序中使用此库:

我在原始问题的底部发布了我的解决方案: Blackberry 应用程序 - 导入代码签名的 jar到应用程序项目中

基本的解决方案是将库构建为 cldc 项目(加上一些其他魔法),而不是库项目。事实上,我必须在 RIM 支持下打开一个案例才能解决这个问题,这真是一团糟……我们的案例很复杂,因为多个应用程序都拥有我们“库”的副本,并且我们的库必须签名。当两个 ALX 文件(来自两个不同的应用程序)都具有相同的签名库文件时,这会导致奇怪的问题。

此解决方案的好处在于,将库添加到应用程序不会强制您拥有多个 COD 文件。

B - 如果您的 Jar 只在一个应用程序中:

那么您应该遵循以下说明:http://supportforums.blackberry.com/t5/Java-开发/Eclipse-1-1-can-I-add-external-3-d-party-J​​AR-library/mp/486787#M98033

I fought with this issue for months...

I have two solutions for you:

A-If you plan on having this library in more than one Application:

I posted my solution at the bottom of my original question: Blackberry Apps - Importing a code-signed jar into an application project

The basic solution was to build the library as a cldc project (plus some other magic), not as a library project. I actually had to open a case with RIM support to figure this out, it was a hot mess... Our case was complicated in that more than one application would have a copy of our "Library" and our library had to be signed. Which caused weird issues when two ALX files (from two different apps) both had the same signed library file.

The nice thing about this solution is that adding the library to the Application doesn't force you to have multiple COD files.

B - If your Jar is only going to be in one Application:

Then you should follow these instructions: http://supportforums.blackberry.com/t5/Java-Development/Eclipse-1-1-can-I-add-external-3-d-party-JAR-library/m-p/486787#M98033

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文