MIDP 2.0 version issues: $method is undefined for $type

为君一笑 提交于 2019-12-05 17:39:19

Sounds like you're using methods defined in CLDC 1.1; the emulator you are using must only support CLDC 1.0 (this would certainly explain the lack of equalsIgnoreCase() and anything involving double and float primitives). See the full API here. And see here for a list of differences between 1.0 and 1.1.

EDIT: Some ways to check the CLDC version of your device:

1) Check the microedition.configuration system property as described here.

System.out.println("The CLDC version is:  " + System.getProperty("microedition.configuration"));

2) Check the existence of a class supported only in 1.1.

try {
    Class.forName("java.lang.ref.WeakReference");
    System.out.println("It's CLDC 1.1");
} catch (ClassNotFoundException e) {
    System.out.println("It's CLDC 1.0");
}

Eclipse references both cldc_1.0.jar and cldc_1.1.jar (as well as midp_2.0.jar and midp_2.1.jar).

To fix it: Go to Window > Preferences > Java ME > Device Managment > your-device > Edit... > Libraries > cldc_1.0.jar > Remove

More details you can find here: http://thompsonng.blogspot.com/2009/09/j2me-setting-eclipse-to-use-cldc-11.html

Even after you have chosen an emulator device that supports CLDC-1.1 , like DefaultCldcJtwiPhone2, you can still configure it to emulate a CLDC-1.0 only phone.

At least that's what the project properties on Netbeans look like.

I got the same problem today(11/03/10) after updating from: SDK 1.6.0_17 + eclipse ee 3.5.1 + Java_ME_platform_SDK_3.0 EA. to: SDK 1.6.0_18 + eclipse ee 3.5.2 + Java_ME_platform_SDK_3.0.

The method ceil(double) is undefined for the type Math The method floor(double) is undefined for the type Math The method abs(int) in the type Math is not applicable for the arguments (double) The method sqrt(double) is undefined for the type Math

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!