Sc4rocko
Sc4rocko

Reputation: 19

javafx Error: JLink Cannot find module-info.java

I am working with JavaFX for the first time and can't run my application. I am using Gradle and added the JavaFx Plugin, everything seemed to work, until I tried to run my application and realised that I need a Runtime Image. The Error: "JavaFX runtime components needed to run this application are missing" showed up. I visited https://openjfx.io/openjfx-docs/ and added the JLink Plugin to my build.gradle file. But now I am getting another error, when I am trying to execute jlink.

Error:

Execution failed for task ':prepareModulesDir'.
> Error while evaluating property 'moduleName' of task ':prepareModulesDir'
   > Failed to query the value of extension 'jlink' property 'moduleName'.
      > Cannot find module-info.java in [C:\Users\nicol\spz_app\dev\App\Spz\spz_app\src\main\java]

build.gradle:

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.8.21'
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.13'
    id 'org.beryx.jlink' version '2.25.0'
}

group = 'org.spz'
version = '1.0-SNAPSHOT'


repositories {
    mavenCentral()
}



dependencies {
    implementation("com.oracle.database.jdbc:ojdbc11:21.1.0.0")
    implementation("mysql:mysql-connector-java:8.0.28")
    // https://mvnrepository.com/artifact/org.yaml/snakeyaml
    implementation 'org.yaml:snakeyaml:2.0'

}


javafx {
    version = "19"
    modules = [ 'javafx.controls' , 'javafx.fxml']
}

    jlink {
    launcher {
        name = 'Main'
    }
    mergedModule {
        requires "java.xml"
    }

}


Apparently I am missing module-info.java but I am not quite sure, what that is?

Upvotes: 1

Views: 588

Answers (0)

Related Questions