简体   繁体   中英

Error - Main Class not found

Can't seem to figure out why this simple program has stopped working on my computer. My programs that I compiled up until a Windows update are fine but when I try to compile a new program I get the following. I've attached a picture of the program and the command prompt error message. I've checked the CLASSPATH and it looks fine.

Program - HelloWorldApp.java

class HelloWorldApp{
     public static void main(String[] args){
        System.out.println("Hello World!"); //Display the string
   }
}

execute javac HelloWorldApp.java - all is fine

execute java HelloWorldApp -

Error: Main method not found in class HelloWorldApp, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application

Please excuse me if this has been answered. I searched but couldn't find this problem

记事本程序的图像和命令提示符中的执行

Have you declared a String class among your list of classes? If so, try using java.lang.String[] args as argument to your main method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM