×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    1

    Question Series 60 Floating point error!

    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();
    		}
    	}
    }

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Moscow/Russia
    Posts
    258
    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

  3. #3
    Registered User
    Join Date
    Dec 2004
    Location
    quezon city philippines
    Posts
    25

    3rd Party emulation classes for CLDC1.1

    Originally posted by henson2K
    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
    I tried following the link..you posted..but i think its down. could you direct me to other links where i could find 3rd party emulators for cldc1.0 devices to run cldc1.1?

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814
    try checking the configuration of your compiler.
    it might be triing to use cldc 1.1, instead of 1.0, and therefore use floats.

  5. #5
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62

    S60_2nd_FP2_MIDP_SDK ERROR: floating-point arguments should not appear

    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 12:22.

  6. #6
    Regular Contributor
    Join Date
    Jan 2004
    Location
    Finland
    Posts
    51
    This must be an emulator bug!

  7. #7
    Regular Contributor
    Join Date
    Oct 2003
    Posts
    62
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×