Skip to content
Mario Zechner edited this page Mar 23, 2014 · 19 revisions

Before you can import your project into Eclipse, make sure you setup your development environment!

Importing to Eclipse

Go to File -> Import -> Gradle -> Gradle Project, click Browse and navigate to the root folder of your project, then click Build Model. After a while, you'll see a root project and subprojects (android, core, desktop, gwt, ios). Select all the projects and click Finish. Note that this process can take a minute or two the first time you do it, as Gradle and some dependencies will be downloaded in the background.

Running Your Application

  • Desktop: Right click the desktop project, Run As -> Java Application. Select the desktop starter class (e.g. DesktopLauncher.java).
  • Android: make sure you have a device connected and that it shows up in DDMS (see Android Developer Guide). Right click your Android project, Run As -> Android Application.
  • iOS RoboVM: Right click the robovm project, Run As -> iOS Device App to run on a connected device, or Run As -> iOS Simulator App to run on the iOS simulator. If you run on a device, you need to provision it to be able to deploy to it!
  • HTML5: Right click the gwt project, Run As -> Gradle Build .... Select superDev mode from the list, click Apply and Run. You can now follow the build process in the console. This will take a while, as your Java code is compiled to Javascript. Once you see the message The code server is ready, fire up your browser and go to http://localhost:9876. Drag the Dev Mode Onbookmarklet to your browser bar. You only have to do this once! Next, go to http://localhost:8080/gwt. This is your app running in the browser! When you change any of your Java code, just click the Dev Mode On bookmarklet while you are on the site and the server at port 9876 will recompile your code and reload the page!

Debugging Your Application

  • Desktop: Right click the desktop project, Debug As -> Java Application. Select the desktop starter class (e.g. Main.java). Set breakpoints where you need them, hot swap code (edit & save while debugging) to quickly test changes without restarting the app.
  • Android: assuming you have a device connected, Debug As -> Android Application. Hot swapping is not supported, but you can use the DDMS perspective to check your memory usage, profile your application and so on. Refer to the Android Development Guide for more information.
  • iOS RoboVM: debugging is currently not supported by RoboVM
  • HTML5: Right click the gwt project, Run As -> Gradle Build .... Select superDev mode from the list, click Apply and Run. You can now follow the build process in the console. This will take a while, as your Java code is compiled to Javascript. Once you see the message The code server is ready, fire up your browser and go to http://localhost:9876. Drag the Dev Mode Onbookmarklet to your browser bar. You only have to do this once! Next, go to http://localhost:8080/gwt. This is your app running in the browser! Click on the Dev Mode On boorkmarklet and hit Compile. In Chrome, press F12 to bring up the developer tools, go to the sources tab and find the Java file you want to debug. Set breakpoints, step and inspect variables using the power of source maps!

Table of Contents

a note from the translation

Wiki Style Guide

Clone this wiki locally