I am using gradle 7.3.1 in Intellij 2021.3 to build a JavaFX application. And I need external libraries dependency for the backend part.
This is the complete build.gradle
script that is pre-built by the idea:
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.10'
id 'org.beryx.jlink' version '2.24.1'
}
group 'com.github.zukarusan'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.8.1'
}
sourceCompatibility = '11'
targetCompatibility = '11'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
mainModule = 'com.github.zukarusan.app'
mainClass = 'com.github.zukarusan.app.MainApplication'
}
javafx {
version = '11.0.2'
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
implementation('org.controlsfx:controlsfx:11.1.0')
implementation('com.dlsc.formsfx:formsfx-core:11.3.2') {
exclude(group: 'org.openjfx')
}
implementation('org.kordamp.ikonli:ikonli-javafx:12.2.0')
implementation('org.kordamp.bootstrapfx:bootstrapfx-core:0.4.0')
implementation('com.github.wendykierp:JTransforms:3.1') // THIS IS THE EXTERNAL LIBRARY I ADDED
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test {
useJUnitPlatform()
}
jlink {
imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
}
}
jlinkZip {
group = 'distribution'
}
and then I updated module-info.java
:
module com.github.zukarusan.app {
requires javafx.controls;
requires javafx.fxml;
requires org.controlsfx.controls;
requires com.dlsc.formsfx;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.bootstrapfx.core;
requires java.desktop;
requires JTransforms; // UPDATED
exports com.github.zukarusan.app.controller;
exports com.github.zukarusan.app.model;
exports com.github.zukarusan.app;
opens com.github.zukarusan.app.controller to javafx.fxml;
}
Before I updated the module-info
, the application launches just fine and shows a javafx window application.
But, after I updated that, java.lang.FindException
is thrown. resulting the following error:
> Task :MainApplication.main() FAILED
Error occurred during initialization of boot layer
java.lang.module.FindException: Module JTransforms not found, required by com.github.zukarusan.app
Do I have to download manually the modules? or any steps that I miss?
Please enlighten me. :'(