尝试在codenameone上启动模拟器时出错

时间:2018-05-14 11:43:27

标签: eclipse codenameone

我刚刚在我的eclipse IDE上安装了codenameone,每当我启动模拟器时都会收到此错误。版本:Eclipse Oxygen Release(4.7.3)Build:20180308-1800。

WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
java.io.IOException: /theme.res not found
at com.codename1.ui.util.Resources.open(Resources.java:740)
at com.codename1.ui.util.Resources.openLayered(Resources.java:704)
at com.codename1.ui.util.Resources.openLayered(Resources.java:668)
at generated.StateMachineBase.startApp(StateMachineBase.java:45)
at generated.StateMachineBase.<init>(StateMachineBase.java:31)
at generated.StateMachineBase.<init>(StateMachineBase.java:96)
at userclasses.StateMachine.<init>(StateMachine.java:18)
at com.mycompany.myapp.HelloWorld.start(HelloWorld.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:123)
at com.codename1.ui.Display.processSerialCalls(Display.java:1129)
at com.codename1.ui.Display.mainEDTLoop(Display.java:924)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.NullPointerException
at generated.StateMachineBase.initTheme(StateMachineBase.java:86)
at generated.StateMachineBase.startApp(StateMachineBase.java:49)
at generated.StateMachineBase.<init>(StateMachineBase.java:31)
at generated.StateMachineBase.<init>(StateMachineBase.java:96)
at userclasses.StateMachine.<init>(StateMachine.java:18)
at com.mycompany.myapp.HelloWorld.start(HelloWorld.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:123)
at com.codename1.ui.Display.processSerialCalls(Display.java:1129)
at com.codename1.ui.Display.mainEDTLoop(Display.java:924)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

1 个答案:

答案 0 :(得分:0)

确保您使用的是JDK 8(不是7,9,10或11)。确保Eclipse本身在JDK 8上运行,这很难看到/配置,因为它可以在eclipse.ini文件中定义。确保JDK 8的bin目录是系统路径中的第一个,并且环境变量JAVA_HOME指向JDK 8。

假设没有一个淘汰......

检查theme.res文件是否在src目录中。按刷新(F5)并检查硬盘上的物理位置。

尝试创建一个不同的项目,看看是否在那里生成了theme.res文件。如果是,您可以将其复制到项目中。

假设它没有查看.codenameone文件夹下的主目录。您应该看到名为designer.jardesigner_1.jar的文件。它在那里吗?

从命令行执行时是否启动?

有关跟踪此类问题的更多信息,请参阅此处https://www.codenameone.com/blog/tip-track-designer-guibuilder-issues.html