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 → disttask.
Option 2
-
Open a terminal and navigate to the project folder:
-
Run:
On Windows, use:
Where to find my distribution?
The files of you distribution can be found in the folder build/libs.
The folder should look like this:
Running the game
On Linux/macOS run the following command in the folder where the files are situated:
On Windows double-click the run.bat file.