Shows “NoClassDefinationFound for java/util/Comparator” though added jre to build path

穿精又带淫゛_ 提交于 2019-12-24 08:47:51

问题


I am using j2me + S60 symbian SDK on win7, initially i've installed with jdk6 and IDE(Eclipse) then i install SDK S60. But as you know that j2me supports only 1.3 compliance level for projects so, i downloaded jdk1.3.1_28 and install it added it to preference -> Java -> installJREs.

So now it will added to build path of new project, but it's not happening if i use Comparator (java.util.Comparator) class it ask me to add 1.3 jre to build path.

I did it but still showing error that " NoClassDefinationFound for java/util/Comparator ".

If i remove that added reference library(jre1.3.1) then shows error on classes such as (Hashmap, Comparator, StringTokenizer which i've used), give suggestions to create class or ask to add jre1.3.1 to build path of project.

I don't understand why its happening .. please help....


回答1:


Some classes you are trying to use are not part of Java ME. You must pay attention to CLDC and MIDP versions and which classes they bring.

If you want to develop a Java ME app using Eclipse, you should use Pulsar http://www.eclipse.org/pulsar/




回答2:


Please see this link, it might be helpful

JDK is not a part of J2ME, so all the api's are not included in it, one must use J2ME CDC API to include them, its basically based on the J2SE 1.3 API

http://jcp.org/aboutJava/communityprocess/review/jsr036/J2ME_CDC_Specification.html



来源:https://stackoverflow.com/questions/10946541/shows-noclassdefinationfound-for-java-util-comparator-though-added-jre-to-buil

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