Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

class not found ! urgent  RSS feed

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!