For the finishing touches of our game, we will deploy the application; for this, LibGDX comes with handy methods. Open the terminal in IntelliJ with Alt + F12 or navigate to the top-left side on View | Tool Windows | Terminal.
To run on the desktop, we can use (other than the buttons on IntelliJ) gradlew desktop:run
. Keep in mind that the running directory will be the in Android project's asset
folder.
To deploy, we will use gradlew desktop:dist
in the terminal. It creates a JAR file in the desktop/build/libs/
folder. It can be run by double-clicking or in the terminal by using java -jar jar-file-name.jar
. Though the operating system needs JVM to run a file, it will work on Windows, Linux, and Mac OS X.