I am building a JavaFX application using gradle (with Kotlin and TornadoFX). Building and running it works fine with the below gradle build and IntelliJ but using the application plugin, and running the application, I get the following error:
Caused by: java.lang.IllegalAccessError: superinterface check failed: class de.codecentric.centerdevice.javafxsvg.SvgImageLoaderFactory (in
unnamed module @0x591c2277) cannot access class com.sun.javafx.iio.ImageLoaderFactory (in module javafx.graphics) because module javafx.gr
aphics does not export com.sun.javafx.iio to unnamed module @0x591c2277
Below is my gradle build script. How can I solve this.
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
}
application {
mainClassName = 'MainKt'
}
javafx {
version = "13"
modules = ['javafx.controls', 'javafx.base', 'javafx.graphics']
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "http://4thline.org/m2"
}
}
dependencies {
...
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}