how to run/debug in eclipse

89 views
Skip to first unread message

howud...@gmail.com

unread,
Jun 28, 2016, 3:49:56 PM6/28/16
to CodenameOne Discussions
In the past with eclipse I launch either the Simulator_???.launch, or send to the server and then install / debug on and android device.  In the GUI builder walkthrough, (https://www.codenameone.com/blog/gui-builder-walkthru.html) it states that simply running the app (shown using netbeans) will generate the code for the GUI Builder form and then runs what appears to be a simulator.  How can I do this in eclipse?  Project->run as shows java applet and java application and neither will build the form and launch the sim.  Launching the Simulator_???.launch doesn't build the GUI Builder code.

Shai Almog

unread,
Jun 29, 2016, 1:24:18 AM6/29/16
to CodenameOne Discussions, howud...@gmail.com
As far as I know it should also build the code but Chen can probably answer that better than I can.
In IntelliJ we automatically update the code the moment you save from the new GUI builder.

Kaya TC

unread,
Jun 29, 2016, 9:59:37 AM6/29/16
to CodenameOne Discussions, howud...@gmail.com
Select your project in the Projectexplorer, then on the upper bar where the Green Button for run is, you should have a {PROJECTNAME}_simulator configuration, otherwise just look for the Simulator_{PROJECTNAME}.launch, right click it, Run As -> Simulator_{PROJECTNAME}

Kaya TC

unread,
Jun 29, 2016, 10:04:07 AM6/29/16
to CodenameOne Discussions, howud...@gmail.com
Am Mittwoch, 29. Juni 2016 15:59:37 UTC+2 schrieb Kaya TC:

Select your project in the ProjectExplorer, then on the upper bar where the Green Button for run is, you should have a PROJECTNAME_simulator configuration, otherwise just look for the "Simulator_PROJECTNAME.launch" in your project, right click it, Run As -> Simulator_PROJECTNAME

howud...@gmail.com

unread,
Jun 29, 2016, 10:07:05 AM6/29/16
to CodenameOne Discussions, howud...@gmail.com
that launches (as does Simulator_{PROJECTNAME}.launch) however that doesn't build the GUI Builder code.

Kaya TC

unread,
Jun 29, 2016, 10:12:26 AM6/29/16
to CodenameOne Discussions, howud...@gmail.com
By GUIBilder Code you dont mean the ant script running and building the projectcode at least, before it launches the Simulator?

Peter Carlson

unread,
Jun 29, 2016, 10:18:00 AM6/29/16
to Kaya TC, CodenameOne Discussions
not sure. GUI Builder creates an xml file.  That xml file is converted to java code as explained in the GUI builder walkthrough, (https://www.codenameone.com/blog/gui-builder-walkthru.html
) where it states that simply running the app (shown using a different IDE, intellij I think, or netbeans) will generate the code.  I assume this is being done as part of the ant script, but I have no clue.  All I know is that there is no GUI builder xml->java when I launch.

Kaya TC

unread,
Jun 29, 2016, 11:07:49 AM6/29/16
to CodenameOne Discussions, kayha...@gmail.com, howud...@gmail.com
Are you using the old GUI BUILDER or the old one? as the new one may differ. I didnt even know that they even released the new GUI Builder until i saw a post on Stackoverflow two hours ago.

howud...@gmail.com

unread,
Jun 29, 2016, 11:25:57 AM6/29/16
to CodenameOne Discussions, kayha...@gmail.com, howud...@gmail.com
new one.

Chen Fishbein

unread,
Jun 29, 2016, 2:28:42 PM6/29/16
to CodenameOne Discussions, kayha...@gmail.com, howud...@gmail.com
Seems like an issue we have in the eclipse plugin, you can invoke the "genGuiSrc" ant task and it will generate the gui src

Peter Carlson

unread,
Jun 29, 2016, 2:43:29 PM6/29/16
to Chen Fishbein, CodenameOne Discussions, kayha...@gmail.com
where do I find that task?

Chen Fishbein

unread,
Jun 29, 2016, 2:48:54 PM6/29/16
to CodenameOne Discussions, cf2...@gmail.com, kayha...@gmail.com, howud...@gmail.com
It should be on your build.xml file

Peter Carlson

unread,
Jun 29, 2016, 3:16:31 PM6/29/16
to codenameone...@googlegroups.com
in my build.xml:
<taskdef name="generateGuiSources"
classname="com.codename1.build.client.GenerateGuiSources"
classpath="CodeNameOneBuildClient.jar"/>

<target name="genGuiSrc">
<generateGuiSources srcDir="src" encoding="UTF-8"
guiDir="res/guibuilder" />
</target>

running it manually still didn't create the code.

Peter Carlson

unread,
Jun 29, 2016, 3:52:52 PM6/29/16
to codenameone...@googlegroups.com

Peter Carlson

unread,
Jun 29, 2016, 3:59:17 PM6/29/16
to codenameone...@googlegroups.com, cf2...@gmail.com, kayha...@gmail.com
BTW, running the ant task with verbose produces:

Apache Ant(TM) version 1.9.6 compiled on June 29 2015
Buildfile: /home/peter/workspace/SDCPMobile/build.xml
parsing buildfile /home/peter/workspace/SDCPMobile/build.xml with URI = file:/home/peter/workspace/SDCPMobile/build.xml
Project base dir set to: /home/peter/workspace/SDCPMobile
parsing buildfile jar:file:/opt/eclipse-neon/plugins/org.apache.ant_1.9.6.v201510161327/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/opt/eclipse-neon/plugins/org.apache.ant_1.9.6.v201510161327/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
 [property] Loading /home/peter/workspace/SDCPMobile/codenameone_settings.properties
 [property] Loading /home/peter/workspace/SDCPMobile/build.props
Property "javac.classpath" has not been set
 [property] Loading Environment env.
Property "env.JAVA_HOME" has not been set
BUILD SUCCESSFUL
Total time: 225 milliseconds

On 06/29/2016 11:48 AM, Chen Fishbein wrote:
It should be on your build.xml file
--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/_YEIlF6bUsQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/d5bb1858-c8ef-43f6-a85e-1c83b793706b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shai Almog

unread,
Jun 30, 2016, 12:03:43 AM6/30/16
to CodenameOne Discussions, cf2...@gmail.com, kayha...@gmail.com, howud...@gmail.com
Not a big expert on Eclipse but try defining the task as dependent on init.
Reply all
Reply to author
Forward
0 new messages