JavaFX with Gradle error module not found

I’m creating a sample demo application with JavaFX in IntelliJ, but I need to use a library called the JavaFaker library. I’m using Gradle as the build system, but every time I try to add the library, either as the implementation in the build.gradle file, or via IntelliJ project structure options, the file says error: module not found. I’ve already tried adding it to modules but nothing changes.

module com.example.demo1 {
    requires javafx.controls;
    requires javafx.fxml;
    requires javafaker;

    opens com.example.demo1 to javafx.fxml;
    exports com.example.demo1;


plugins {
    id 'java'
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.10'
    id 'org.beryx.jlink' version '2.24.1'

group 'com.example'
version '1.0-SNAPSHOT'

repositories {

ext {
    junitVersion = '5.8.2'
    javaFakerVersion = '1.0.2'

sourceCompatibility = '17'
targetCompatibility = '17'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'

application {
    mainModule = 'com.example.demo1'
    mainClass = 'com.example.demo1.HelloApplication'

javafx {
    version = '17.0.1'
    modules = ['javafx.controls', 'javafx.fxml']

dependencies {

test {

jlink {
    imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip") as RegularFile
    options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
    launcher {
        name = 'app'

jlinkZip {
    group = 'distribution'

error message

> Task :HelloApplication.main() FAILED
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafaker not found, required by com.example.demo1

added library via project structure


That library is neither a proper JPMS module, nor does it have an Automatic-Module-Name manifest entry.
Due to that the standard JPMS support of Gradle does not put it on the module path, but on the class path afair and due to that it also is not available as module when compiling through Gradle by default.

Actually according to 1.0.3 release · Issue #700 · DiUS/java-faker · GitHub that library seems to be abandoned but has a maintained fork at

That one also seems to neither be a proper module, nor having an automatic module name, but as it is maintained, you might have a better chance to get it fixed there.