Blackberry extrenal library problem (module not fo

2019-04-15 00:19发布

I am using eclipse. When I add an external jar (import it.sauronsoftware.ftp4j.*;) it seems to be ok, I reference the external jar by right clicking project and the properties. When I instantiate an FTPclient opbject and run in the simulator I get "module not found".

Somebody on a different forum suggested creating a new library and adding the jar to it, then reference this library as a dependency in my main bb project. The downside to this is that I the library must be installed along with the compiled bb app and I dont want this. Is there another way to import third party libs into eclipse with blackberry plugin that will make this work?

thanks

1条回答
甜甜的少女心
2楼-- · 2019-04-15 00:38

my solution is (for eclipse plugin):

  1. Generate/get *.jar file.
  2. Preverify *.jar file using preverify tool (it's in JDE_DIR\components\bin):

    preverify -classpath {jde.home}\lib\net_rim_api.jar {output.file} -d {output.dir}

above command will produce preverified *.jar in: {output.dir}\output\

in eclipse:

  1. Add preverified *.jar to build path: (Right click on project -> Libraries -> Add JARs)
  2. Export *.jar: (Right click on project -> Libraries ->Order and Export -> check your *.jar)
  3. Run application, it should work now

You can write ant script to automate this process

Cheers, M

查看更多
登录 后发表回答