error when trying to launch simulator on codenameone

3

I just installed codenameone on my eclipse IDE and I get this error whenever I launch the simulator. Version: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)
eclipse
codenameone
asked on Stack Overflow May 14, 2018 by Adeyefa

1 Answer

1

Make sure that you are running with JDK 8 (not 7, 9, 10 or 11). Make sure Eclipse itself is running on JDK 8 which is hard to see/configure as it's definable in the eclipse.ini file. Make sure that the bin directory of JDK 8 is the first in the system path and that the environment variable JAVA_HOME points at JDK 8.

Assuming none of these panned out...

Check if the theme.res file is in the src directory. Press refresh (F5) and check the physical location on the hard disk.

Try creating a different project and see if a theme.res file is generated there. You can copy it to your project if it is.

Assuming that it isn't look at your home directory under the .codenameone folder. You should see a file called designer.jar or designer_1.jar. Is it there?

Does it launch when executed from the command line?

See this for more on tracking such issues https://www.codenameone.com/blog/tip-track-designer-guibuilder-issues.html

answered on Stack Overflow May 15, 2018 by Shai Almog

User contributions licensed under CC BY-SA 3.0