Im building a jar using Gradle. Im using Intellij and Java 1.8, and everything seems to be alright when im running it in the Intellij environment, but when i want to start the jar i got the following Error:

```
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/scene/control/skin/BehaviorSkinBase
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
        at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at org.controlsfx.control.PropertySheet.createDefaultSkin(PropertySheet.java:254)
        at javafx.controls/javafx.scene.control.Control.doProcessCSS(Unknown Source)
        at javafx.controls/javafx.scene.control.Control.access$000(Unknown Source)
        at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.scene.control.skin.BehaviorSkinBase
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 67 more
Exception running application de.informatik.gitlab2.itv.Main

```

There are two external dependencys (controlsfx and jdom2) which are inclouded via maven in the gradle build file.

This is the build.gradle file im using:

```
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.8
repositories {
    mavenCentral()
}
configurations {
    libs
}
dependencies{
    testCompile group: 'junit', name: 'junit', version: '4.12

    // https://mvnrepository.com/artifact/org.jdom/jdom
    libs group: 'org.jdom', name: 'jdom', version: '2.0.0'
    // https://mvnrepository.com/artifact/org.controlsfx/controlsfx
    libs group: 'org.controlsfx', name: 'controlsfx', version: '8.40.14'

configuration.compile.extendsFrom(configurations.libs)
}
jar {
    manifest {
        attributes 'Main-Class': 'de.informatik.gitlab2.itv.Main'
    }
    from {
        configurations.libs.collect { it.isDirectory() ? it : zipTree(it) }
    }
}

```

**EDIT**

After adding

```
compile group: 'net.java.openjfx.backport', name: 'openjfx-78-backport-compat', version: '1.8.0.1'

```

into the build.gradle this Error occurs:

```
Exception in Application start method
Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: com/sun/javafx/scene/control/skin/BehaviorSkinBase
        at org.controlsfx.control.PropertySheet.createDefaultSkin(PropertySheet.java:254)
        at javafx.controls/javafx.scene.control.Control.doProcessCSS(Unknown Source)
        at javafx.controls/javafx.scene.control.Control.access$000(Unknown Source)
        at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Unknown Source)
        at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.doCSSPass(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.access$3500(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(Unknown Source)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/scene/control/skin/BehaviorSkinBase
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
        at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at org.controlsfx.control.PropertySheet.createDefaultSkin(PropertySheet.java:254)
        at javafx.controls/javafx.scene.control.Control.doProcessCSS(Unknown Source)
        at javafx.controls/javafx.scene.control.Control.access$000(Unknown Source)
        at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Unknown Source)
        at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
        at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
        at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
        at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSSImpl(Unknown Source)
        at javafx.controls/com.sun.javafx.scene.control.ControlHelper.superProcessCSS(Unknown Source)
        at javafx.controls/javafx.scene.control.Control.doProcessCSS(Unknown Source)
        at javafx.controls/javafx.scene.control.Control.access$000(Unknown Source)
        at javafx.controls/javafx.scene.control.Control$1.doProcessCSS(Unknown Source)
        at javafx.controls/com.sun.javafx.scene.control.ControlHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
        at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
        at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.doProcessCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Parent.access$400(Unknown Source)
        at javafx.graphics/javafx.scene.Parent$1.doProcessCSS(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.ParentHelper.processCSSImpl(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.NodeHelper.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Node.processCSS(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.doCSSPass(Unknown Source)
        at javafx.graphics/javafx.scene.Scene.preferredSize(Unknown Source)
        at javafx.graphics/javafx.scene.Scene$2.preferredSize(Unknown Source)
        at javafx.graphics/com.sun.javafx.scene.SceneHelper.preferredSize(Unknown Source)
        at javafx.graphics/javafx.stage.Window$12.invalidated(Unknown Source)
        at javafx.base/javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
        at javafx.base/javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
        at javafx.graphics/javafx.stage.Window.setShowing(Unknown Source)
        at javafx.graphics/javafx.stage.Window.show(Unknown Source)
        at javafx.graphics/javafx.stage.Stage.show(Unknown Source)
        at de.uniwuerzburg.informatik.gitlab2.itv.Main.start(Main.java:35)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.scene.control.skin.BehaviorSkinBase
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 67 more
Exception running application de.informatik.gitlab2.itv.Main

```

**EDIT2**
I've edited the build.gradle file :

```
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()

}

dependencies {

//
    // https://mvnrepository.com/artifact/org.jdom/jdom
    compile (
            [group: 'org.jdom', name: 'jdom', version: '2.0.0'],
            [group: 'org.controlsfx', name: 'controlsfx', version: '8.40.14'],
            [group: 'net.java.openjfx.backport', name: 'openjfx-78-backport-compat', version: '1.8.0.1']
    )
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

mainClassName = 'de.informatik.gitlab2.itv.Main'

jar {
    manifest {
        attributes( 'Main-Class': 'de.informatik.gitlab2.itv.Main',
                'Class-Path' : configurations.compile.collect{ it.getName() }.join(''))
    }
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}

```

After making a clean Gradle build this is the code of the MANIFEST.MF

```
Manifest-Version: 1.0
Class-Path: jdom-2.0.0.jarcontrolsfx-8.40.14.jaropenjfx-78-backport-co
 mpat-1.8.0.1.jar
Main-Class: de.informatik.gitlab2.itv.Main

```

And here is the structure of the jar:

```
...
css
de
fxml
impl
java
javax
lang
META-INF
netscape
nodes
org
sun
controlsfx.properites

```

My two dependencies are in der folder 'org'. Shouldnt be in the Manifest a classpath with org/...? And is it a mistake that there are no whitespaces in the MANIFEST.MF between the different dependencies and if how do i solve it?

The Exception when running from the cmd is the same as above:

```
Exception in Application start method
Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: com/sun/javafx/scene/control/skin/BehaviorSkinBase
        at org.controlsfx.control.PropertySheet.createDefaultSkin(PropertySheet.java:254)

```