After creating a javafx jar with a double click, nothing happens. I tried it through the bat file writers Error: Could not find or load main class sample.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application Although if i run the jar from idea then everything works.There is a MANIFEST in the JAR file, the path to the main class is spelled out. What could be the reason of the guys?
Asked
Active
Viewed 27 times
-2
-
What Java version do you use? Do you use OpenJFX? – dan1st May 29 '22 at 12:45
-
I was building a program on jdk 8, javafx 18.0.1 – Dezoway May 29 '22 at 13:01
-
1Java 8, at least the distribution from Oracle, should include JavaFX 8 (likely won't be the case if your OS is Linux). It doesn't make sense to use Java 8 and a separate JavaFX 18—plus, JavaFX 18 requires Java 11+. What does `java -version` output (executed from the command line)? – Slaw May 29 '22 at 13:05
-
java version "11.0.14" 2022-01-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.14+8-LTS-263) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.14+8-LTS-263, mixed mode).The fact is that in intellij idea I use jdk 8 to build. Jre costs corretto 1.8 – Dezoway May 29 '22 at 13:25