You Are Here:

Community: Developer Discussion Boards

#1 Old Question Series 60 Floating point error! - 2005-03-16, 18:04

Join Date: Mar 2005
Posts: 1
pdrnsf
Offline
Registered User
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();
		}
	}
}
Reply With Quote

#2 Old 2005-03-17, 00:31

Join Date: Mar 2003
Posts: 258
Location: Moscow/Russia
Send a message via ICQ to henson2K
henson2K
Offline
Regular Contributor
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
Reply With Quote

#3 Old 3rd Party emulation classes for CLDC1.1 - 2005-03-18, 07:54

Join Date: Dec 2004
Posts: 25
Location: quezon city philippines
rj_cybersilver
Offline
Registered User
Quote:
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?
Reply With Quote

#4 Old 2005-03-18, 17:11

Join Date: Mar 2005
Posts: 499
Location: Paris
njzk2
Offline
Regular Contributor
try checking the configuration of your compiler.
it might be triing to use cldc 1.1, instead of 1.0, and therefore use floats.
Reply With Quote

#5 Old S60_2nd_FP2_MIDP_SDK ERROR: floating-point arguments should not appear - 2005-04-05, 22:37

Join Date: Oct 2003
Posts: 62
meijerpb
Offline
Regular Contributor
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.
Reply With Quote

#6 Old 2005-04-07, 15:12

Join Date: Jan 2004
Posts: 51
Location: Finland
kakoskin
Offline
Regular Contributor
This must be an emulator bug!
Reply With Quote

#7 Old 2005-04-07, 16:23

Join Date: Oct 2003
Posts: 62
meijerpb
Offline
Regular Contributor
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia