您必须在类路径运行时异常中的LWUIT之前包含平台端口 [英] You must include the platform port before the LWUIT in the classpath runtime exception

查看:124
本文介绍了您必须在类路径运行时异常中的LWUIT之前包含平台端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用LWUIT.出色的工作和出色的程序.我正在使用Netbeans 6.9.1,S60 SDK和LCWUIT的Webstart版本.

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.

我遇到的第一个问题是我无法预先验证Transitions3D.java文件,但这不是问题.我只是删除了那部分代码,并从头开始重新编译了库.因此,我创建了一个带有"Hello World"标签的简单表单,并尝试了资源编辑器的"Create Netbeans Project"选项.我在test_MIDP(其中test是我的项目的名称)上进行了干净构建",并尝试在模拟器上运行它.但是,我收到此错误消息:

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

您必须在类路径中的LWUIT之前包括平台端口"

关于如何解决此错误的任何想法?我尝试同时使用S60和JavaME SDK 3.0仿真器运行MIDlet,但收到了相同的错误.

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警告我,有类似的问题,但是我找不到与我的问题相关的任何信息.如果没有,请通知我.

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

推荐答案

我将回答我自己的帖子:

I shall answer my own post:

问题是我包含在UI jar中. LWUIT带有2个UI.jar集.通用文件位于LWUIT \ UI文件夹中,而平台特定的文件位于LWUIT \ Ports文件夹中.该通用文件被用作包含所有通用代码的父"项目,但是,如果必须导入.jar文件适用于您的平台.如自述文件所述:

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.

在重新编译该库以删除Transitions3D.java文件时,我重新编译了(然后导入了)通用UI.jar.正确的方法是编译,父项目(通用UI.jar)然后编译端口特定的库(在我的情况下为LWUIT \ ports \ MIDP \ UI.jar),然后将其导入您的项目中,您就完成了

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.

这篇关于您必须在类路径运行时异常中的LWUIT之前包含平台端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆