0

My java version:

java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)

I'm trying to run a .jar file from command line in windows 10 but still I'm getting below error

C:\Users\admin>java -jar E:\cupcarbon\tmp\cupcarbon.jar
Error: Could not find or load main class cupcarbon.CupCarbon
Caused by: java.lang.NoClassDefFoundError: javafx/application/Application

I have downloaded openjfx externally and provided the path as well but still the same error

sticky bit
  • 36,626
  • 12
  • 31
  • 42
Aj.24
  • 1
  • 1
  • Did you create the jar file? If you did, please add your file structure. – OctopuSS7 Mar 13 '21 at 16:53
  • 1
    Does this answer your question? [How to solve java.lang.NoClassDefFoundError?](https://stackoverflow.com/questions/17973970/how-to-solve-java-lang-noclassdeffounderror) – hfontanez Mar 13 '21 at 16:57

1 Answers1

0

It looks like the file structure of the source is set up incorrectly. To extract the original files, use jar xf jar-file [archived-file(s)], and look for main.java. Also have a look at this question: https://askubuntu.com/questions/1136420/java-lang-noclassdeffounderror-javafx-application-application.

OctopuSS7
  • 465
  • 2
  • 9