Skip to main content

java.lang.Error: ClassFormatError: 56

2 replies [Last post]
Joined: 2009-04-08

Hello everyone,

I am trying to deploy a simple J2ME application on PhoneME. I am following this tutorial:

When I try to run the application, I get the following error:

java.lang.Error: ClassFormatError: 56
- java.lang.Class.forName(), bci=0
- .unknown..newInstance(), bci=1
- com.sun.midp.midlet.MIDletStateHandler..unknown.(), bci=63
- com.sun.midp.midlet.MIDletStateHandler..unknown.(), bci=17
- com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=24
- .unknown...unknown.(), bci=9
- .unknown...unknown.(), bci=5
- .unknown...unknown.(), bci=159
- com.sun.midp.main.MIDletSuiteLoader.main(), bci=9

I've followed strictly the tutorial, including preverifying the class.

I've downloaded "MR2 binary bundle (b23) - Linux/x86", I am using CLDC-1.1 and MIDP-2.1. I am running a 64 bit Gentoo with multilib (I can run 32 bit applications).

What causes such error? Should I build PhoneME instead of using the binary version?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-01-03

You probably compiled the java sources with a jdk 5 or 6 java compiler, but
J2ME does not recognize class files compiled with such a recent compiler. The
class file format should be compatible with jdk 1.4. You can achieve this by
recompiling the sources with

javac -source 1.4 -target 1.4 ...


Joined: 2009-04-08

It works now, thanks for the help :)