Fork us on GitHub

TIP: Track Designer & GUIBuilder Issues

Help us pinpoint issues and get to work faster
TIP: Track Designer & GUIBuilder Issues

TIP: Track Designer & GUIBuilder Issues

We are on a mid-bootcamp break so the blog is back to life during this time (and there is so much to write!), more on that tomorrow but for now I’d like to write about fixing & tracking issues with the designer (resource editor) and the GUI builder.

Both of these tools have issues most of which resolve around their connection to the IDE. The reason for this is that they are external tools that aren’t a part of the IDE, this allows us to support all 3 IDE’s without too much of an effort but also creates some issues that are often hard to debug.

When you open either the designer or the GUI builder we install a JAR file within your system. This JAR file is located under the .codenameone directory in your home directory. E.g. on Linux/Mac it would be ~ but for Windows it can be under several hierarchies, see this.

Once you locate the home directory peak inside, you should see two files: designer_1.jar & guibuilder_1.jar.

Both will only exist if you opened the designer and GUI builder, also notice that the _1 part of the file name might be missing

Command Line

You can launch both tools from Command Line. These tools write errors to the system console and you would see errors if they occur. Notice that both tools need Java 8 to work…​ To launch the designer use:

java -jar designer_1.jar path-to-file.res

To launch the GUI builder use:

java -jar guibuilder_1.jar

If you see errors please look them over and let us know what the full set of errors is.

Problem: Designer Won’t Launch

This happens to some Eclipse users. The designer will launch from command line but not from Eclipse. Despite many attempts we failed to reproduce this.

Our current working theory is that Java home and the Java in the system path are incompatible maybe due to 64/32 bit modes or an older version of Java. Another theory is that a path with spaces or invalid characters is causing this issue.

If you are experiencing this issue please review your environment:

  • The bin directory of the JDK (important, the JDK not the JRE) must be first in the system path. Before anything else! Especially before Windows as some versions of the JDK stick Java into the system directory

  • JAVA_HOME must point at the JDK directory

  • You should have administrator privileges, I’m not sure if this is essential but please test this

  • Look in eclipse.ini and verify that the JDK listed there matches the JDK from the path

GUI Builder Issues

There are several reasons for this and we try to address them with newer releases. To understand how this works check out the .guiBuilder directory in your home directory. In this directory you should see a file called guibuilder.input which is responsible for picking the right file to edit. This is mine:

<?xml version="1.0" encoding="UTF-8"?>
<con name="GuiBuilderTutorial" formName="MyGuiForm"  file="file:/Users/shai/temp/GuiBuilderTutorial/res/guibuilder/com/mycompany/myapp/MyGuiForm.gui" javaFile="file:/Users/shai/temp/GuiBuilderTutorial/src/com/mycompany/myapp/" resFile="file:/Users/shai/temp/GuiBuilderTutorial/src/theme.res" outputFile="file:/Users/shai/.guiBuilder/733a5319-ceeb-458c-abad-6e2a6a061e05.ouput" running="file:/Users/shai/.guiBuilder/733a5319-ceeb-458c-abad-6e2a6a061e05" />

The important attributes here are file and javaFile. The former represents the XML gui file and the latter represents the Java source file related to that. If the path is invalid the GUI builder won’t find the right files and won’t know what to do.

The content of the .gui file might also be important if the GUI builder suddently stops working for a specific file.


Please use the comments section for additional tips/questions on how to track issues in the GUI builder & the designer. I’ll try to update this post with newer details for GUI builder & designer debugging.

Hopefully, having this as a good resource will allow us to improve the tools to a level that this resource will become obsolete.

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.