Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Mobile Tools for Java (MTJ) » DataOutputStream.writeFloat(can't access to this function when specifying CLDC 1.1)
DataOutputStream.writeFloat [message #493167] Fri, 23 October 2009 12:54 Go to next message
mediamana  is currently offline mediamana
Messages: 4
Registered: October 2009
Junior Member
Hi,

I'm using sun java me sdk 3.0, defaultcldcmsaphone1 emulator and CLDC 1.1 in the application descriptor.

In my project i can't access to the writeFloat function.
If i try directly on sun platform i can access to it so the function is present in cldc 1.1 jar but in eclipse i can't access to it.

Thanks for your help
Maximilien

[Updated on: Fri, 23 October 2009 12:54]

Report message to a moderator

Re: DataOutputStream.writeFloat [message #493172 is a reply to message #493167] Fri, 23 October 2009 13:24 Go to previous messageGo to next message
mediamana  is currently offline mediamana
Messages: 4
Registered: October 2009
Junior Member
Sorry for the post, it's the same problem than

Eclipse User wrote on Tue, 25 August 2009 18:27
Originally posted by: graffitici.yahoo.com

Hi everyone,

I am trying to run a simple J2ME program that I found online. I loaded it
as a project, but still could not get it to compile. There are quite a few
preverifier errors, but I think I have diagnosed the main source of the
problem (which, I believe, will fix the preverifier errors too). It should
be a simple configuration issue, but I need your help in order to find
what's going on!

At some point in the code, there is a reference to Math.abs(float).
Eclipse marks this as an error, saying that "abs(int) is not applicable to
abs(float)." Looking at the documentation below, I noticed that the
overloaded version was introduced in CLDC 1.1:

http://www.j2ee.me/javame/reference/apis/jsr118/java/lang/Ma th.html#abs(float)

It seemed that the reason why Eclipse was complaining is because it was
using CLDC 1.0 and not 1.1. When I expand the "Java ME Library" under the
project explorer, I can see that both cldc_1.0.jar and cldc_1.1.jar are
there. When I look at the project properties, the current active
configuration ("DefaultCldcMsaPhone2") does support CLDC1.1.

I have no idea what is happening, and would appreciate any help!

Thanks,
Berk


So the same solution work Embarrassed

David Lucena wrote on Wed, 26 August 2009 01:42
This happened to me also, but not in the same case, but in the case o a String method.

The problem you have is that both CLDC 1.0 and CLDC 1.1 libraries are configured in your device. Also you may notice that both MIDP 2.0 and MIDP 2.1 also are.

I don't know why, but by default eclipse, or MTJ, uses de default one. In the definitions of the device, you will see they have CLDC 1.1 available, but not in the Device Management Grid under Java ME tree.

In order to change this. Go to preferences, Java ME, select the device. Click on edit. Go to Libraries tab, and remove CLDC 1.0. Then save it, close Eclipse and run it again.

This should work. At least it worked for me.

Please, tell me if this helped.

[Updated on: Fri, 23 October 2009 13:26]

Report message to a moderator

Re: DataOutputStream.writeFloat [message #501452 is a reply to message #493172] Wed, 02 December 2009 12:22 Go to previous message
Marcel RUff is currently offline Marcel RUff
Messages: 12
Registered: December 2009
Junior Member
Hi,

The bug still exists in my
Vista
eclipse 3.5.1
MTJ 1.0.1
Java_ME_platform_SDK_3.0

environment.

Workaround:
Removing the CLCD 1.0 library and restart eclipse did help

Window -> Preferences -> Java ME -> Device Management -> DefaultCldcPhone2 ->
Edit -> Libraries -> cldc_1.0.jar: Remove -> Restart eclipse


I have added a comment to https://bugs.eclipse.org/bugs/show_bug.cgi?id=284768

regards
Marcel
Re: DataOutputStream.writeFloat [message #578472 is a reply to message #493172] Wed, 02 December 2009 12:22 Go to previous message
Marcel RUff is currently offline Marcel RUff
Messages: 12
Registered: December 2009
Junior Member
Hi,

The bug still exists in my
Vista
eclipse 3.5.1
MTJ 1.0.1
Java_ME_platform_SDK_3.0
environment.

Workaround:
Removing the CLCD 1.0 library and restart eclipse did help

Window -> Preferences -> Java ME -> Device Management -> DefaultCldcPhone2 ->
Edit -> Libraries -> cldc_1.0.jar: Remove -> Restart eclipse

I have added a comment to https://bugs.eclipse.org/bugs/show_bug.cgi?id=284768

regards
Marcel
Previous Topic:Can't use Random.nextInt(int) or Thread.interrupt() in CLDC 1.1 with JavaME SDK 3.0
Next Topic:Can't manage to get a running Netbeans project to work on eclipse
Goto Forum:
  


Current Time: Mon Sep 15 09:29:33 GMT 2014

Powered by FUDForum. Page generated in 0.03005 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software