Next up, you need to import your project into your IDE.

Importing the Project

  1. IntelliJ IDEA or Android Studio, you can choose to open the build.gradle file and select “Open as Project” to get started. Eclipse, choose File -> Import... -> Gradle -> Existing Gradle Project (make sure that your freshly generated project is not located inside of your workspace). NetBeans it is File -> Open Project.
  2. You may need to refresh the Gradle project after the initial import if some dependencies weren’t downloaded yet. IntelliJ IDEA/Android Studio, the Reimport all Gradle projects button is a pair of circling arrows at the top left in the Gradle tool window, which can be opened with View -> Tool Windows -> Gradle. Eclipse right click on your project Gradle -> Refresh Gradle Project.

    Getting it Running

    If you want to execute your freshly imported project, you have to follow different steps, depending on your IDE and the platform you are targeting.

    Desktop

    In IDEA/Android Studio:

  3. 2. Alternatively, you can create a run configuration:
  4. core/assets folder (or android/assets if you are using an Android subproject) 5.

    In Eclipse:

  5. DesktopLauncher class
  6. core/assets (or android/assets if you are using an Android subproject)

    In NetBeans:

    Right click the desktop project -> Run

    Android

  • IDEA/Android Studio: Right click AndroidLauncher -> Run AndroidLauncher
  • Eclipse: Right click Android project -> Run As -> AndroidApplication
  • NetBeans: Right click Android project -> Run As -> AndroidApplication

    iOS

    In IDEA/Android Studio

  1. 2.
  2. 2. documentation.

    In Eclipse

    - documentation.

    HTML

    HTML is best suited to be run on command line. You are welcome to manually setup GWT in the IDE of your choice if you are familiar with it, but the recommended way is to drop down to terminal or command prompt. Super Dev mode, which allows you to recompile on the fly, and debug your application in browser. To do so, open up your favourite shell or terminal, change directory to the project directory and invoke the respective gradle task:
    1. ./gradlew html:superDev
    On Unix: If you get a permission denied error, set the execution flag on the gradlew file: chmod +x gradlew You should see lots of text wizzing by, and if all goes well you should see the following line at the end: , to see your application running, with a recompile button. GWT documentation.

    Command Line

    All the targets can be run and deployed to via the command line interface. Desktop:
    1. ./gradlew desktop:run
    Android:
    1. ./gradlew android:installDebug android:run
    ANDROID_HOME environment variable needs to be pointing to a valid android SDK before you can do any command line wizardry for Android. On Windows, use: set ANDROID_HOME=​C:/Path/To/Your/Android/Sdk; on Linux and macOS: export ANDROID_HOME=​/Path/To/Your/Android/Sdk. Alternatively you can create a file called “local.properties” with the following content: sdk.dir /Path/To/Your/Android/Sdk. iOS:
    1. ./gradlew ios:launchIPhoneSimulator
    HTML:
    1. ./gradlew html:superDev
    .

    Gradle tasks are failing?

    --debug parameter to the command, e.g.:
    1. ./gradlew desktop:run --debug
    This will provide you with a stacktrace and give you a better idea of why gradle is failing.

    What to do next?

    A Simple Game for a step-by-step guide.