| Reply | « Previous Thread | Next Thread » |
|
I`m new to programming in J2ME and am trying to create a program using the Nokia series 60 2nd edition SDK. I`m also using ktoolbar and MIDP 1.0.
It works fine if I use the default emulator that comes with ktoolbar but when I use the series 60 one I get the following error: Error preverifying class java.lang.String ERROR: floating-point arguments should not appear com.sun.kvem.ktools.ExecutionException: Preverifier returned 1 Build failed I dont have any floats in my code as far as I can tell and so dont know how to get it working. A basic Hello World program I created also does the same, the code is as follows, Anyone have any ideas? Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
//Midlet class
public class HelloWorldMIDlet extends MIDlet
{
public HelloWorldMIDlet() { }
public void startApp()
{
//Get display
Displayable current = Display.getDisplay(this).getCurrent();
if(current == null)
{
//Create new screen
HelloScreen helloScreen = new HelloScreen(this, "Hello World.");
//Set the screen
Display.getDisplay(this).setCurrent(helloScreen);
}
}
public void pauseApp() { }
public void destroyApp(boolean b) { }
void exitRequested()
{
destroyApp(false);
notifyDestroyed();
}
}
class HelloScreen extends TextBox implements CommandListener
{
private final HelloWorldMIDlet midlet;
private final Command exitCommand;
//Constructor
HelloScreen(HelloWorldMIDlet midlet, String string)
{
//Create text box
super("HelloWorldMIDlet", string, 256, 0);
//Get the midlet
this.midlet = midlet;
//Create Command button
exitCommand = new Command("Exit", Command.EXIT, 1);
//Add the command
addCommand(exitCommand);
//Listen for command presses
setCommandListener(this);
}
public void commandAction(Command c, Displayable d)
{
if(c == exitCommand)
{
midlet.exitRequested();
}
}
}
|
|
There is no Float data type in CLDC 1.0 devices.
You need to use CLDC 1.1 compatible device or 3rd party emulation classes. For example http://henson.newmail.ru/j2me/Float.htm |
|
Join Date: Dec 2004
Posts: 25
Location: quezon city philippines
Offline
Registered User
|
|
|
Quote:
|
| rj_cybersilver |
| View Public Profile |
| Find all posts by rj_cybersilver |
|
try checking the configuration of your compiler.
it might be triing to use cldc 1.1, instead of 1.0, and therefore use floats. |
|
I have the same problem with S60_2nd_FP2_MIDP_SDK while my MIDlet uses no floats.
The older Series_60_MIDP_SDK_2_1 does not give this problem for me. Peter Meijer http://www.seeingwithsound.com/midlet.htm
Last edited by meijerpb : 2005-04-07 at 13:22.
|
|
This must be an emulator bug!
|
|
Problem now "fixed" when using the WTK ktoolbar by
changing the project settings' API selection from CLDC 1.0 to CLDC 1.1, even though I do not use any floating point. Compilation gives no errors now, but I wonder if the result will still work with CLDC 1.0 devices? Peter Meijer |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|