2

I recently started using LWUIT. Great job and great program. I'm using Netbeans 6.9.1, S60 SDK and the webstart version of LCWUIT.

The first problem I faced was that I couldn't preverify Transitions3D.java file , however that was not an issue. I just removed that part of the code and recompiled the library from scratch. So I created a simple form with a "Hello World" Label and tried the "Create Netbeans Project" option of the resource editor. I did a Clean Build at the test_MIDP (where test is the name of my project) and tried to run it on the emulator. However I'm receiving this error message:

TRACE: <at java.lang.RuntimeException: You must include the platform port before the LWUIT in the classpath>, startApp threw an Exception
java.lang.RuntimeException: **You must include the platform port before the LWUIT in the classpath**
        at com.sun.lwuit.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:67)
        at com.sun.lwuit.Display.init(Display.java:400)
        at userclasses.MainMIDlet.startApp(MainMIDlet.java:15)
        at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
        at com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
        at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
        at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
        at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
        at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
        at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
java.lang.RuntimeException: You must include the platform port before the LWUIT in the classpath
        at com.sun.lwuit.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:67)
        at com.sun.lwuit.Display.init(Display.java:400)
        at userclasses.MainMIDlet.startApp(MainMIDlet.java:15)
        at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
        at com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
        at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
        at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
        at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
        at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
        at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26

"You must include the platform port before the LWUIT in the classpath"

Any ideas on how to fix this error? I tried to run the MIDlet with both S60 and JavaME SDK 3.0 emulator and I received the same error.

StackOverflow warned me that there are similar questions however I couldn't find anything about related to my issue. If not please inform me.

gnat
  • 6,213
  • 108
  • 53
  • 73
tdgs
  • 173
  • 2
  • 9
  • did you try with some other emulators? – bharath Apr 01 '11 at 11:22
  • no I didn't , I don't have any other installed ,my project is about nokia phones anyway,however I don't think that it has to do sth with the emulators,it's the same mistake in both JavaMESDK 3.0 and in S60,what are the chances?also thanx for the edit.Any general ideas about the problem? – tdgs Apr 01 '11 at 13:56
  • what version of LWUIT you are using? – bharath Apr 01 '11 at 14:00
  • The webstart version from the LWUIT site. Unfortunately it doesn't say anywhere version however it should be the last one. – tdgs Apr 02 '11 at 12:30
  • use latest LWUIT and checkout [here.](http://java.net/projects/lwuit) – bharath Apr 04 '11 at 05:14

1 Answers1

4

I shall answer my own post:

The problem was that in the UI jar I was including. LWUIT comes with 2 "sets" of UI.jar. The generic one which is in LWUIT\UI folder and the platform specific ones which are in the LWUIT\Ports folder.The generic one is being used as "parent" project containing all the common code,however if you MUST import the .jar file which is for your platform. As readme file says:

While these projects will compile easily they will be useless for any purpose since they don't include the binding glue for the platform, to use the platform one needs to use the appropriate projects underneath the specific ports directory to a given platform.

While I was recompiling the library in order to remove Transitions3D.java file, I recompiled (and then imported ) the generic UI.jar. The correct thing to do is compile, the parent project (the generic UI.jar) THEN compile the port specific library (in my case the LWUIT\ports\MIDP\UI.jar) and then import it in your project and you are done.

gnat
  • 6,213
  • 108
  • 53
  • 73
tdgs
  • 173
  • 2
  • 9