Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException when running in KToolBar.

 
Michael Jay
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All.

With already a couple of years experience in Java for the desktop. I am trying out J2ME.

I've compiled my first program which should simply say "Hello" but in the process of launching the file, a ClassNotFoundException is thrown. I know the nature of the error but any idea what's causing this is, because I've checked the directory structure and it all seems intact e.g. the .class file is in the "class" folder, likewise the .java file is in the "src" folder. Is this a bug issue. Have any of you experienced this.

I would be grateful if you could demystify me on the aforementioned.

Thanks in advance.
 
Avais Aziz
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MIDlet constructor should be 'public', this a common mistake, so check
this first.

Cheers
 
Nidheesh Puthalath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if u used any package structure in Hello.java it should be mentioned in ur jad file also. otherwise ClassNotFoundException will be thrown.

ie. if ur Hello.java is in com.x.hello package then Midlet-1 entry of ur jad should be like,
MIDlet-1: Hello,Hello.png,com.x.hello.Hello

i think this will help u

Nidheesh.
 
Michael Jay
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers Guys.

I'm gonna give this a try and will inform you of the outcome.

All the best.
 
Michael Jay
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to let you know that I tried your method Nidheesh and it seems to be working now.

At least now this can be used as future reference.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic