This question seems very similar if not exactly the same. In that question, Slaw's 2nd suggestion involving fixing the module-info
for correct module management seems appropriate. But what exactly does that mean; or rather, is there something wrong with my module that javafx is complaining about or is it some other module it's talking about?
This is my module-info.java
module myprogram.main {
requires javafx.controls;
requires javafx.fxml;
requires janino;
requires commons.compiler;
requires org.fxmisc.richtext;
requires wellbehavedfx;
requires zt.process.killer;
requires zt.exec;
exports com.bla.myprogram;
opens com.bla.myprogram to javafx.fxml;
}
jdk: jdk16.0.1+9
java -jar .\MyProgram.jar
@Override
public void start(Stage primaryStage) throws Exception {
System.out.println("enter start");
...
public static void main(String[] args) {
System.out.println("enter main");
launch();
}
enter main
Aug 04, 2021 1:22:52 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6203f37a'
enter start
(and this is my gradle.build if it has any significance)
plugins {
id 'java-library'
id 'application'
id 'org.openjfx.javafxplugin' version "0.0.10"
}
group 'com.bla.myprogram'
version '0.3'
def currentOS = org.gradle.internal.os.OperatingSystem.current()
def platform
if (currentOS.isWindows()) {
platform = 'win'
} else if (currentOS.isLinux()) {
platform = 'linux'
} else if (currentOS.isMacOsX()) {
platform = 'mac'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
implementation "org.openjfx:javafx-base:11:${platform}"
implementation "org.openjfx:javafx-graphics:11:${platform}"
implementation "org.openjfx:javafx-controls:11:${platform}"
implementation "org.openjfx:javafx-fxml:11:${platform}"
implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.7'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.6'
implementation group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3.3'
implementation group: 'org.zeroturnaround', name: 'zt-process-killer', version: '1.10'
implementation group: 'org.zeroturnaround', name: 'zt-exec', version: '1.12'
}
test {
useJUnitPlatform()
}
javafx {
version = "16"
modules = [ 'javafx.controls', 'javafx.fxml']
}
mainClassName = 'com.bla.myprogram.Main'
jar {
manifest {
attributes "Main-Class": 'com.bla.myprogram.Main'
}
from { (configurations.runtimeClasspath).collect { it.isDirectory() ? it : zipTree(it) } } {
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
task createProperties(dependsOn: processResources) {
doLast {
new File("$buildDir/resources/main/version.properties").withWriter { w ->
Properties p = new Properties()
p['version'] = project.version.toString()
p['name'] = rootProject.name.toString()
p.store w, null
}
}
}
classes {
dependsOn createProperties
}