1

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

MobileEvangelist
  • 2,583
  • 1
  • 25
  • 36
  • Have you added the J2ME profile library to your build path ? Before starting development on any J2ME application you have to set your profile CDC CLDC. In this profile there is the required libraries you may use. JDK is not a part of J2ME – Houcem Berrayana Jun 08 '12 at 09:51
  • I've added JavaME library[S60 5th Edition SDK v1.0/S60 Emulator] by default and for reference added jre1.3.1. can you please tell me how to set profile CDC CLDC. – MobileEvangelist Jun 08 '12 at 10:03
  • If you are on Eclipse you could choose a library from the build path settings panel. That's how you do it – Houcem Berrayana Jun 08 '12 at 13:11
  • i also tried that way to add collections.jar but it still gives error.(But not doing any sort of log, only show error red mark on project folder). I checked error log it gives error while deleting LWUIT.jar file and also shows Plug-in'org.eclipse.mtj.ui'contributed an invalid menu extenstion. what does it mean and why ... – MobileEvangelist Jun 08 '12 at 13:23
  • your issues look like those asked (and answered) in an older question: [How to deal with the most common classes missing on J2ME](http://stackoverflow.com/questions/859449/how-to-deal-with-the-most-common-classes-missing-on-j2me) – gnat Jun 08 '12 at 16:42

2 Answers2

2

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/

Telmo Pimentel Mota
  • 4,033
  • 16
  • 22
1

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

Kumar Vivek Mitra
  • 33,294
  • 6
  • 48
  • 75
  • you should write something regarding the link, simple link giving is not an answer – Lucifer Jun 08 '12 at 10:13
  • i'm not able to use classes i mention above question. I tried to add jre1.6 as reference lib. but it's not tacking files from it. After deploying the app give Hashmap class definition not found it takes classes only mention in JavaME library util packge(i'm sure). I also tried to add collections.jar to build path but after adding it, shows error .. please tell me the way i use these classes – MobileEvangelist Jun 08 '12 at 11:28
  • If i remove that jre1.6 from build path it gives error on classes wherever i used and suggest to add jre1.3 to build path , then it must to use classes from it's util package but it's not same error persists what should i do... – MobileEvangelist Jun 08 '12 at 11:30
  • link provided most of links from it are not working, provide some direct discussion link if you have any.. – MobileEvangelist Jun 08 '12 at 11:46
  • I've also checkout the CLDC-javadoc it doesn't include these classes. Is there any way to add external jar, as i tried it it gives error. suggest any other way – MobileEvangelist Jun 08 '12 at 12:35
  • go the link i mentioned, it clearly shows that java.util.comparator is included in CDC API...I repeat... J2ME CDC API – Kumar Vivek Mitra Jun 08 '12 at 12:58