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

651 views Asked by At

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....

2

There are 2 answers

6
Kumar Vivek Mitra On

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

0
Telmo Pimentel Mota On

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/