Skip to content

Deployment

When you create a game using the SaxionGameApp wrapper (which includes LibGDX), you need a way to run and share your application, so that it can be played by other users. IntelliJ makes this easy with Gradle tasks and runnable JAR files.

A runnable JAR file is a file that can be executed by any computer that has the Java Virtual Machine installed (JRE 21).

Your Gradle configuration has a dist task that can be used to create a runnable jar. In addition, two run scripts will be created run.sh (for linux and mac) and run.bat (for windows). These scripts will execute the java -jar command for you, so that the jar file is started.

Running the dist task

Option 1

  • In IntelliJ open up the Gradle window (right side of the screen)
  • Run the distribution → dist task.

Option 2

  1. Open a terminal and navigate to the project folder:

    cd examples/1-shapes
    
  2. Run:

    ./gradlew dist
    

    On Windows, use:

    gradlew.bat dist
    

Where to find my distribution?

The files of you distribution can be found in the folder build/libs.

The folder should look like this:

mygame-1.0.0.jar
run.sh
run.bat

Running the game

On Linux/macOS run the following command in the folder where the files are situated:

.run.sh

On Windows double-click the run.bat file.