J2ME Programming Issue on VM: 1.5.0_06
Hi guys, I have tried to run the following codes (compiled with no
problem) from an IDE (JCreator LE) and i got the following exceptions.
However i managed to run it on the sun java windows tool kit's
KToolbar..
SOURCE CODE
------------
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class TinyMIDlet extends MIDlet implements CommandListener{
String s = "Hello \"cruel\" world!";
private Command quit;
private Display ourDisplay;
private Form ourForm;
private TextField ourField;
public TinyMIDlet(){
ourDisplay = Display.getDisplay(this);
quit = new Command("quit", Command.SCREEN, 2);
}
public void startApp(){
ourForm = new Form ("our first!");
ourField= new TextField ("J2ME App", s, 256, 0);
ourForm.append(ourField);
ourForm.addCommand(quit);
ourForm.setCommandListener(this);
ourDisplay.setCurrent(ourForm);
}
public void pauseApp(){
}
public void destroyApp(boolean unconditional){
}
public void commandAction(Command c, Displayable s){
if (c == quit){
destroyApp(false);
notifyDestroyed();
}
}
public static void main(String[] a){
TinyMIDlet hfj2me = new TinyMIDlet();
}
}
EXCEPTION GENERATED
-------
Exception in thread "main" java.lang.UnsatisfiedLinkError: getProperty0
at com.sun.midp.main.Configuration.getProperty0(Native Method)
at
com.sun.midp.main.Configuration.getProperty(Configuration.java:33)
at
com.sun.midp.midlet.Scheduler.getScheduler(Scheduler.java:144)
at com.sun.midp.midlet.MIDletState.<init>(MIDletState.java:301)
at
javax.microedition.midlet.MIDletProxy.<init>(MIDletProxy.java:33)
at javax.microedition.midlet.MIDlet.<init>(MIDlet.java:70)
at TinyMIDlet.<init>(TinyMIDlet.java:12)
at TinyMIDlet.main(TinyMIDlet.java:42)
Do i have to install any dll files before i can run this from my IDE?
Please advice.
Thanks (a lot) in advance.
JPractitioner - 28 Mar 2006 06:23 GMT
hi guys, please give some comments.. any comments will do :)
Roedy Green - 28 Mar 2006 07:45 GMT
On 27 Mar 2006 01:49:04 -0800, "JPractitioner"
<JPractitioner@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>UnsatisfiedLinkError
see
http://mindprod.com/jgloss/runerrormessages.html#UNSATISFIEDLINKERROR

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
JPractitioner - 31 Mar 2006 11:19 GMT
Hey Roedy, thanks dude.
really appreciate your reply.
seems like i have todeal with native libraries.
No wonder, it never showed error during compilation
Thanks again.
Roedy Green - 31 Mar 2006 20:01 GMT
On 27 Mar 2006 01:49:04 -0800, "JPractitioner"
<JPractitioner@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>Exception in thread "main" java.lang.UnsatisfiedLinkError: getProperty0
> at com.sun.midp.main.Configuration.getProperty0(Native Method)
> at
this is a bit peculiar. It looks as if the JVM is having trouble
finding its OWN native code.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.