Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

J2ME - NoClassDefFoundError: Expected an initialized class

Status
Not open for further replies.

blundellp

Technical User
Apr 6, 2005
25
0
0
GB
Hey guys trying to create a GPS application that tracks your movement as you walk, i've successfully created this as a free standing midlet, however when i'm now trying to port it into another one of my midlets i'm getting this error:

java.lang.NoClassDefFoundError: Expected an initialized class

I believe its coming from the line commented:-


Code:
try {
           if(provider == null) {
              Criteria crit = new Criteria();  //HERE java.lang.NoClassDefFoundError: Expected an initialized class
              provider = LocationProvider.getInstance(crit);
              provider.setLocationListener(this, -1, -1, -1);       
           }
         } 
        catch (LocationException e) {
           e.printStackTrace();
           provider = null;
         }

I found an old forum post sayin it was something to do with the the lapi.jar file and a class path problem?
http://www.velocityreviews.com/foru...ationcriteria-class-lapijar-midp-20-j2me.html
(I dont no what or where the lapi.jar is)

Is this something to do with my code or something to do with my dev env?

I have it working in a different project using a different midlet which is annoying, the working midlet ask's for a security response "this midlet is trying to use the location API allow?". However this midlet giving the error does not ask.

I'm using eclipse dev, any ideas?

Please reply in the most lamens terms you can, I dont want to keep saying huh?!

thanks for your time and effort! just ask if you need more info

blundell x x
 
If only i'd checked my emulator version. Sony erikson v.7 doesnt support location api, version 8+ does. problem solved!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top