You need to port our J2ME application to a specific platform, either Nokia, Samsung or LG, etc. You have to use OEM's specific API to implement a feature, but that special API is not included J2ME standard library, nor included in the OEM's J2ME SDK. You got an ZIP or jar file of the API library, but mostly it they are just stub classes, the only real implementations are inside the actual devices. What you need to do is adding the library in your project class path, but without including them into the J2ME jar file.
In NetBeans IDE, You can add the libray of zip/jar file in your J2ME project without including in the packaged jar file. Here are the steps:
- Select your project, right click mouse, choose "Properties"
- Select Build - Libraries & Resources, click button "Add Jar/Zip ...", then select the libray file you want to add, press "Open"
- You will see the library file is included the file/folder list, pleases make sure uncheck the "Package" checkbox, this is the most important step, it will tell IDE don't include this jar/zip file into your J2ME jar file, or IDE will not build successfully, because it can not find dependencies packages for the libraries. The screen shot is attached at the end of this article.
- Select OK, and build your J2ME application