Can you integrate Java 1.6 classes into Eclipse Blackberry project?

徘徊边缘 提交于 2019-12-12 04:44:43

问题


I am using the latest IDE for eclipse and have attached the blackberry 5.0 sim. i am a new bb developer and i was wondering if there is any way of integrating java 1.6 classes (or any 3rd party jars) within the blackberry project without getting an error similar to the following:

org.apache.axis2.util.Utils$3: Warning!: Duplicate method only differs by return type: run
org.apache.axis2.jaxws.util.WSDL4JWrapper: Warning!: Duplicate method only differs by return type: getFirstPortBinding
C:\Program Files\Eclipse\axis\axis2-1.5.1\lib\axis2-transport-http-1.5.1.jar(org/apache/axis2/transport/http/ApplicationXMLFormatter.class): Error!: Duplicate definition for 'org.apache.axis2.transport.http.ApplicationXMLFormatter' found in: org.apache.axis2.transport.http.ApplicationXMLFormatter

I know why i am getting this error (because of duplicate definitions for the same class)....but am i really stuck just sticking to "net.rim" classes within my project? if i wanted to use the "asList()" method, can i not do that because that's outside of the RIM classes?

I am really just hoping that i can integrate outside jars into my blackberry project without getting "duplicate" warnings and error messages.


回答1:


All source code and external libraries used in your BlackBerry app must conform to J2ME which you can think of as a subset of the Java SDKs. J2ME is quite limited - for example there are no Collections classes in J2ME (just the older Vector, etc.). The language level used by the compiler is Java 1.3.

So in a nutshell - you're going to have a hard time porting over third-party libraries unless they were specifically designed to run in a J2ME environment.




回答2:


You can't uses the JDK 6, you need the JDK 5. You can integrate third parties jars except if you want:

  • I/O
  • Swing

In those cases you need to uses the Blackberry API.



来源:https://stackoverflow.com/questions/2058845/can-you-integrate-java-1-6-classes-into-eclipse-blackberry-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!