Page 1 of 1

[ask]Error Java WTK

Posted: 21 Jul 2011, 18:55
by SinauUbuntu
Lagi iseng2 nyoba j2me developing.
Tapi dimana2 kalo coba2 pasti ada salahnya...

Code:
// Sample adapted from http://developers.sun.com/mobility/midp ... /wtoolkit/
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld
extends MIDlet
implements CommandListener
{
private Form mMainForm;
public HelloWorld()
{
mMainForm = new Form("HelloWorld");
mMainForm.append(new StringItem(null, "Hello, World!"));
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
public void startApp()
{ Display.getDisplay(this).setCurrent(mMainForm); }
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s)
{ notifyDestroyed(); }
}
Error:
Unable to create MIDlet HelloWorld
java.lang.ClassNotFoundException: HelloWorld
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
kenapa ya???
dicari di google adanya penjelasan WTK di "wedous"...

Re: Error Java WTK

Posted: 21 Jul 2011, 19:17
by dhiemaz_mitnick
ClassDefNotfoundException itu error umum yang dikarenakan class atau library yang diperluin ga lo includekan didalam paket jar nya..

Re: Error Java WTK

Posted: 21 Jul 2011, 20:06
by SinauUbuntu
jadi yang dibenerin apanya?
masih belum paham...

*mohon maklum :)

Re: Error Java WTK

Posted: 21 Jul 2011, 21:29
by dhiemaz_mitnick
Lo bikinnya ini pake Eclipse atau pake netbeans..? kalo pake eclipse, lo copy semua jar yang berkaitan dengan code yang lo gunakan kedalam projectnya lo ini.

Re: Error Java WTK

Posted: 21 Jul 2011, 21:30
by dhiemaz_mitnick
coba masukan jar / library ini "javax.microedition.midlet.*;" kedalam project lo..

Re: Error Java WTK

Posted: 22 Jul 2011, 18:41
by SinauUbuntu
saya pake' Java Wireless toolkit for CLDC...
sudah "import javax.microedition.midlet.*;"