JavaFX Exception in thread “main” java.lang.NoClassDefFoundError: javafx/application/Application

前端 未结 11 1275
半阙折子戏
半阙折子戏 2020-12-01 08:09

I\'m getting this error

Exception in thread \"main\" java.lang.NoClassDefFoundError: javafx/application/Ap
plication
        at java.lang.ClassLoader.defineC         


        
11条回答
  •  天命终不由人
    2020-12-01 08:29

    IntelliJ and maybe other IDE's do not refactor your Run/Debug configuration. You must manually change your package name preceding the name of your Main class. For instance, change 'sample.Main' to 'com.company.package.ui.Main' so it will launch correctly next time you try to run it. The IDE might have already marked the Run/Debug button with a red cross because it couldn't find the main class. It also gives a warning when you open the Run/Debug configuration.

提交回复
热议问题