Export .jar from Gradle Project in SDK 3.6.1

Hi all,
I am working on a project in the JME3 SDK and before I get any further, I want to make sure I can distribute it. It is based on a Gradle project, as that is what the wiki recommends, despite everything being relevant to Ant, specifically the “Application Deployment” section. I was able to find the generated .jar in ~/build/libs, but when I run it (java -jar GradleGame-1.0.jar), I get this error.

Error: Could not find or load main class com.mygame.Main
Caused by: java.lang.NoClassDefFoundError: com/jme3/app/SimpleApplication

Now this is just the .jar being exported, but I know that Ant has options for exporting .exe, and .app for Windows and Mac. Is there any way to do this with Gradle?
Thanks!

Easiest is to use the builtin Gradle command distZip. That’ll create exes and bats for you. For more advanced packing like bundling JRE and all that, you can search the forum (or the Internet). There are so many options to choose from, that makes it difficult perhaps.

For example:

2 Likes