Blackberry 上如何使用第三方 Library (jar)

关于黑莓上如何使用第三方jar包的问题,折腾我好几天了。下面是我从黑莓官方网站上直接copy下来的,这种方法我测试过了。下面的描述是基于BB自己的IDE操作的,Eclipse上没有试过。

如有任何问题可以留言联系我,我尽量帮你们解答。


[size=large]Article Number: DB-00042[/size]
[size=large]Summary[/size]
This article applies to the following:

BlackBerry® wireless devices based on Java™
BlackBerry Java Development Environment (JDE)

[size=large]Details[/size]
You can include classes from other compiled JAR files in your application. To include these files, save the JAR file in a new project in the same workspace as your application. Make this new project a library application and make your application dependent on this library. You can then import all of its classes. The following steps make up this procedure.

To create a new project

Open the workspace that contains your application's project.
Create a new project.
To add a compiled JAR file to the project

In the navigation pane, select the project.
On the [color=red]Build[/color] menu, select [color=red]Project[/color] >[color=red] Add File to Project. [/color]
Select the appropriate JAR file and click [color=red]Open.[/color]
To make the project a library

In the navigation pane, select the project.
Right-click and select[color=red] Properties.[/color] The <Project name> Class Properties window appears.
Click the[color=red] Application[/color] tab.
From the [color=red]Project Type[/color] drop-down list, select [color=red]Library[/color].
To compile the project

In the navigation pane, select the project.
Right-click and click [color=red]Build Project[/color].
To make the project dependent on the new library

In the navigation pane, select the project.
Right-click and click [color=red]Project Dependencies[/color]. The Class depends on <Project name:> window appears.
Select the [color=red]<Project name>[/color] check box.

重启下IDE后
Your application can now import the classes in this JAR file with the import “xxx.yyy.*” command.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值