【问题标题】:You must include the platform port before the LWUIT in the classpath runtime exception您必须在类路径运行时异常中的 LWUIT 之前包含平台端口
【发布时间】:2011-04-01 08:42:13
【问题描述】:

我最近开始使用 LWUIT。伟大的工作和伟大的计划。我正在使用 Netbeans 6.9.1、S60 SDK 和 LCWUIT 的 webstart 版本。

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

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,但收到了同样的错误。

StackOverflow 警告我有类似的问题,但是我找不到与我的问题相关的任何信息。如果没有,请告诉我。

【问题讨论】:

  • 你试过其他模拟器吗?
  • 不,我没有,我没有安装任何其他的,我的项目是关于诺基亚手机的,但我认为它与模拟器无关,它是一样的JavaMESDK 3.0 和 S60 中的错误,有什么机会?也感谢编辑。关于这个问题的任何一般想法?
  • 您使用的是什么版本的 LWUIT?
  • 来自 LWUIT 站点的 webstart 版本。不幸的是,它没有说任何版本,但它应该是最后一个。
  • 使用最新的 LWUIT 并结帐here.

标签: java-me lwuit midp


【解决方案1】:

我会回答我自己的帖子:

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

虽然这些项目很容易编译,但由于它们不包含平台的绑定胶水,因此它们对于任何用途都毫无用处,但要使用该平台,需要将特定端口目录下的适当项目用于给定平台。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-13
    • 2018-05-09
    • 1970-01-01
    • 2016-01-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多