Using classes from cwmlib jar in BGS5 project in Eclipse | Thales IoT Developer Community
October 29, 2019 - 9:20pm, 2247 views
Hi.
I am attempting to use some of classes from cwmlib library in my new project for BGS5 module. I am developing in Eclipse Juno. Everything is configured according to instructions in Java User Guide pdf. Configuration of external cwmlib library is also done, so the project compiles without errors.
The problem is when I try to build and run midlet package. Generated package does not contain classes from cwmlib jar, so execution ends with ClassNotFoundException. Should I set some property in Eclipse to include cwmlib jar contents in midlet package?
Best regards, Marcin
Hello,
yes, in order to export cwmlib library you need to open project properties, select Java Build Path and open order and Export tab. The you should check the libraries you want to export (cwmlib or any other external library).
Regards,
Bartłomiej
Hello.
I tried Your suggestion on a project delivered with BGS5 install CD - AtCmdDemo for Eclipse. Here is how project build path looks like:
Creating midlet package end without errors, but jar wile created as a result contains only one class - AtCmdDemo.class. I use Eclipse Juno, mtj plugin and java from BGS5 install CD.
On the other hand, compilation and packaging of AtCmdDemo project from WTKSamples works and builds archive with all cwmlib classes as a result.
Do you have any suggestions about what to check or where to look for some configuration issue?
Best regards, Marcin.
Hello,
So it seems that it's some Eclipse or plugin issue. Please double click on application descriptor and verify the tabs if the caonfiguration is correct. You may also clean the project.
Regards,
Bartłomiej
I think I solved my problem by installing the most recent version of Eclipse (2019-09) and MTJ plugin in version 2. Now cwmlib is attached into generated jar file.
Thank you for this information.
We generally recommend using the versions from our installation CD as proved to be working. But if the mentioned version works for you, it is also fine.