Okay so I made a game using Libgdx and I intended it to be a android app(which is why i use android studio) but I want to let my friend without android phones try it out. The project is already setup for both desktop and android so is there any way to export this as a executable jar file?
Exporting A Libgdx Game as Executable Jar from Android Studio
Asked Answered
Type the command below in the terminal. Remember that you have to be in your LibGDX root directory, before issuing this command.
gradlew desktop:dist
More at: https://github.com/libgdx/libgdx/wiki/Gradle-on-the-Commandline#packaging-for-the-desktop
um I don't really understand the gradlew stuff, where do I type this? –
Endotoxin
Nvm I figured it out that its the windows command line and that I need to cd to the project directory which has the build.gradle stuff and then use these commands –
Endotoxin
(For IntelliJ) You can open the "Gradle" panel at the right of theIDE and expand ":desktop", "other" and then double click on ":desktop:dist" –
Keyway
You have to type
gradlew desktop:dist
command in Terminal in Android Studio. Then you should have an executable jar file in your project directory/desktop/build/libs.
It doesn't necessarily need to be the terminal in AS. You can use any terminal to do this. Make sure the current working directory is the project root since
gradlew
is located there –
Impolitic This is a MUCH better answer than the one above since the jar file is built in a weird location, I couldn't see where it was an assumed it was failed. Thanks. –
Aquinas
© 2022 - 2024 — McMap. All rights reserved.