Hi, Im tinkering with j2me, testing the HelloWorld coming with the toolkit. I have set path to ..\midp1.0.3fc\bin, then i tried compiling, that works. Next step: preverifying using, preverify -classpath D:\j2me_cldc\midp1.0.3fcs\classes; D:\abc\HelloWorld it creates the verified class in examples\helloworld\ folder. But it throws error "Error loading class d:\abc\HelloWorld" Now when i go to the examples folder & try "midp HelloWorld" it throws the following error, Warning: could not open config file(d:\j2me_cldc\midp1.0.3.fcs\lib;\lib\internal.config): storageOpen() d:\j2me_cldc\midp1.0.3.fcs\lib;\lib\internal.config: No such file or directory Warning: could not open config file(d:\j2me_cldc\midp1.0.3.fcs\lib;\lib\system.config): storageOpen() d:\j2me_cldc\midp1.0.3.fcs\lib;\lib\system.config: No such file or directory java.lang.ClassNotFoundException: HelloWorld How do I solve this? Also funny thing , it somehow works with earlier version of MIDP.
- Vinod<br />-------<br />SCJP2
Pooja Rao
Greenhorn
Joined: Dec 09, 2001
Posts: 9
posted
0
First of all, In your path you also need to set for cldc..check it out .It should be d:\j2me\j2me_cldc\bin;d:\j2me\midp1.0.3fcs\bin; and classpath should be set to d:\j2me\midp1.0.3fcs\classes; If your path settings are correct then try this.. If you have written the preverify command exactly as in your cmd..then I suppose you forgot to include -d option before specifying where to place the preverified classes.i.e. < preverify -classpath<br /> c:\j2me\midp1.0.3fcs\classes;. -d c:\abc HelloWorld > The option -classpath c:\j2me\midp-fcs\classes;. specifies where to locate the class files for preverification. This includes the MIDP classes that are needed as part of the verification process (specified by c:\j2me\midp1.0.3fcs\classes) and your class file, which is located in the current directory (specified by "."). The option -d c:\abc informs the preverifier where to put the verified class files. The "c:\abc" specifies that particular directory. Now go to the 'abc' directory and run the midlet. [ January 10, 2002: Message edited by: Pooja Rao ]
Vinod Venugopal
Ranch Hand
Joined: Dec 06, 2000
Posts: 148
posted
0
Hi Pooja, Before posting the problem, I had done exactly the same thing as u suggested ,every step was the same, but still it threw the error. I even ran the midp command from both places , the current directory as well as the output directory, but no success. Any ideas? Vinod
Pooja Rao
Greenhorn
Joined: Dec 09, 2001
Posts: 9
posted
0
Hi, So it means that preverification is correct.The problem may be in running the midlet.Now run the midlet as <midp -classpath . HelloMidlet> if your preverified classes are in the current directory.Hope this works...