r/JavaFX • u/delinkvent • Dec 28 '23
Help Issue with OpenJFX and OpenJDK 21 when attempting to run a JAR
Both versions are 21.0.1 windows-x64 on Windows 10.
I've copied the OpenJFX SDK to my OpenJDK folder and confirmed the correct java -version output. Trying java -jar on command line wouldn't run the javafx application from a user folder, so I sought help from existing SO (and elsewhere) posts, some suggesting java.exe must be made aware of javafx similar to these openjfx.io instructions.
This only removed the first layer of my issue:
Caused by: java.lang.NoClassDefFoundError: javafx/application/ApplicationA new error appeared reading as follows:
java.lang.LayerInstantiationException: Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.baseAs I was searching for the cause of the other issue, I haven't found any suggestions other than the one to simply disregard (remove, rename, etc.) jrt-fs.jar which didn't exactly help run the program correctly, but at least printed an error trace stack showing faults within the application itself.
My question is, how can I run .class and .jar files from my CMD without removing jrt-fs.jar from the lib folder of my OpenJDK? I thought installing both OpenJDK and OpenJFX was straightforward, but now I'm wondering if some manual configuring is needed for them to coexist?
I'm sure both JDK 21 and JFX SDK 21 work well together with Eclipse or IntelliJ builds supporting recent Java versions, but I just want to do something as simple as executing JARs from my command line.
View all comments
Show parent comment
1
u/delinkvent Dec 28 '23
I can correct that easier than anything else, i.e. putting JDK and JFX in their discrete folders. But how does that solve the configuration issue?