Generate a JAR file that links the assets for a LibGDX project using gradle
<p>i'm having an issue when i try to generate a jar file for a desktop game that i made using LibGDX. The problem is that i run the following command:</p>

<pre><code>gradlew desktop:dist
</code></pre>

<p>in the Windows command line it generates the jar file in Project/desktop/build/libs folder but when i double click it it closes immediately.</p>

<p>I tried to run it with the following command:</p>

<pre><code>java -jar desktop-1.0.jar
</code></pre>

<p>It prints this
<a href="https://i.stack.imgur.com/ZPX3L.png" rel="nofollow noreferrer">Error</a></p>

<p>I'm new to LibGDX and graddle but i think the problem is in the gradle.build file in my desktop project folder, in the line</p>

<pre><code>project.ext.assetsDir = new File("../core/assets");
</code></pre>

<p>My assets are in the core project folder since i unchecked the Android box in the LibGDX project setup and it runs properly when i do it in Netbeans (using the gradle project plug in).</p>

<p>I'm desperate, this is the last thing that i need to finish this project at the uni.</p>

<p>Any help is appreciated.</p>