使用Java SE功能黑莓手机的问题 [英] BlackBerry problem using Java SE features
问题描述
我已经net_rim_api.jar导入到我的项目。
我也想用非J2ME类样的StringTokenizer和PrintWriter的从标准的rt.jar,但是当我运行应用程序它给人的误差
I have imported net_rim_api.jar into my project. I also want to use non-j2me classes like StringTokenizer and PrintWriter from the standard rt.jar, but when I run the application it gives the error
的Java / IO / UTFDataFormatException
重复类定义错误。
"java/io/UTFDataFormatException" Duplicate class definition error.
我怎样才能解决这个问题?
How can i solve this problem?
推荐答案
你提到的类是J2ME的一部分,所以如果你想使用依赖于一类具有相同名称的非J2ME类(即J2SE)(即J2SE等价类),你有问题。
The class you mention is part of J2ME, so If you want to use non-J2ME classes (i.e. J2SE) that rely on a class of the same name (i.e. the J2SE equivalent class), you have a problem.
我不知道它是值得的,但如果你能识别的全套所需的SE类,并使用不同的包名(从源代码编译它们像 my.java.io
)后你可以在端口你需要的功能额外位,避免冲突。你会带来刚需到项目的J2SE code的本地副本。
I'm not sure it's worth it, but if you can identify the full set of SE classes needed, and compile them from source using a different package name (something like my.java.io
for example) you could port over the extra bits of functionality you need, and avoid the clash. You would be bringing a local clone of just the J2SE code needed into your project.
这篇关于使用Java SE功能黑莓手机的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!