title: JNI Error - libGDX ApplicationListener not found
body: <p>So I've just exported my project as a JAR-file. I'm only making a desktop application. When trying to run the program i get<br>
  "A JNI error has occurred.." Not much else there. However, in the command prompt it is revealed that</p>
  
  <p>"Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/ApplicationListener"</p>
  
  <p>So the libGDX ApplicationListener can't be found? It works perfectly when compiling/running in Eclipse.</p>
  
  <p><em>I'm using:</em><br>
  Windows 7 Ultimate<br>
  Eclipse Oxygen.3a<br>
  Gradle 4.4.1<br>
  java JRE version 1.8.0_241<br>
  java JDK version 1.8.0_241    </p>
  
  <p><em>Environment variables:</em><br>
  <strong>PATH_HOME:</strong> "C:\Program Files\Java\jdk1.8.0_241"<br>
  <strong>var:</strong> "C:\Program Files\Java\jdk1.8.0_241\bin"<br>
  <strong>Path:</strong> "C:\Program Files (x86)\Common Files\Oracle\Java\javapath; C:\ProgramData\Oracle\Java\javapath; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Gradle\gradle-4.4.1\bin"</p>
  
  <p>Main class</p>
  
  <pre><code>public class DesktopLauncher
  {
      public static boolean rebuildAtlas = true;
      public static boolean drawDebugOutline = true;
  
      public static void main (String[] arg)
      {
          // Build Texture Atlases
          if (rebuildAtlas) {
              Settings settings = new Settings();
              settings.maxWidth = 1024;
              settings.maxHeight = 1024;
              settings.combineSubdirectories = true;
  
              // Pack images in "textures" folder
              TexturePacker.process("assets/textures", "assets/atlas", "textures.atlas");
  
          }   
  
          LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
  
          cfg.title = "TI Helper";
          cfg.useGL30 = false;
          cfg.width = Cn.RESOLUTION_WIDTH;
          cfg.height = Cn.RESOLUTION_HEIGHT;
          cfg.fullscreen = true;
  
          new LwjglApplication(new ti_app(), cfg);
      }
  }
  </code></pre>
  
  <p>Desktop build.gradle        </p>
  
  <pre><code>apply plugin: "java"
  
  sourceCompatibility = 1.8
  sourceSets.main.java.srcDirs = [ "src/" ]
  sourceSets.main.resources.srcDirs = ["../core/assets"]
  
  project.ext.mainClassName = "com.lf.desktop.DesktopLauncher"
  project.ext.assetsDir = new File("../core/assets")
  
  task run(dependsOn: classes, type: JavaExec) {
      main = project.mainClassName
      classpath = sourceSets.main.runtimeClasspath
      standardInput = System.in
      workingDir = project.assetsDir
      ignoreExitValue = true
  }
  
  task debug(dependsOn: classes, type: JavaExec) {
      main = project.mainClassName
      classpath = sourceSets.main.runtimeClasspath
      standardInput = System.in
      workingDir = project.assetsDir
      ignoreExitValue = true
      debug = true
  }
  
  task dist(type: Jar) {
      manifest {
          attributes 'Main-Class': project.mainClassName
      }
      dependsOn configurations.runtimeClasspath
      from {
          configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
      }
      with jar
  }
  
  dist.dependsOn classes
  
  </code></pre>
  
  <p>Core build.gradle       </p>
  
  <pre><code>apply plugin: "java"
  
  sourceCompatibility = 1.8
  [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  
  sourceSets.main.java.srcDirs = [ "src/" ]
  </code></pre>
  
  <p>Workspace build.gradle        </p>
  
  <pre><code>buildscript {
  
      repositories {
          mavenLocal()
          mavenCentral()
          maven { url "https://plugins.gradle.org/m2/" }
          maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
          jcenter()
          google()
      }
      dependencies {
  
      }
  }
  
  allprojects {
      apply plugin: "eclipse"
      version = '1.0'
      ext {
          appName = "TIHelper"
          gdxVersion = '1.9.10'
          roboVMVersion = '2.3.8'
          box2DLightsVersion = '1.4'
          ashleyVersion = '1.7.0'
          aiVersion = '1.8.0'
      }
  
      repositories {
          mavenLocal()
          mavenCentral()
          jcenter()
          google()
          maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
          maven { url "https://oss.sonatype.org/content/repositories/releases/" }
      }
  }
  
  project(":desktop") {
      apply plugin: "java-library"
  
      dependencies {
          implementation project(":core")
          api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
          api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
          api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
          api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
          api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
          api "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"  
      }
  }
  
  project(":core") {
      apply plugin: "java-library"
  
      dependencies {
          api "com.badlogicgames.gdx:gdx:$gdxVersion"
          api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
          api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
          api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
          api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
          api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
          api "net.dermetfan.libgdx-utils:libgdx-utils:0.13.4"
          api "net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.13.4"
          api "com.badlogicgames.ashley:ashley:$ashleyVersion"
      }
  }
  
  </code></pre>
  
  <p>Singular unsettling tales also suggests I could be missing some sort of native JAR-file (gdx-native.jar or something like that) among my <a href="https://i.stack.imgur.com/lbaFH.png" rel="nofollow noreferrer">external dependencies</a></p>
  
  <p>But those topics where years of age so I guess I have it, it's just named <strong>"gdx-platform-1.9.10-natives-desktop.jar"</strong> nowadays. Or  is the problem related to the fact that the project says <strong>Native library location: (none)</strong>? I'm kinda lost here I must say. Are the libGDX jars not exported?</p>