Error: Can not find the main method in the class ConstructorTest1, set the main method is defined as: public static void main (String [] args) Otherwise Ja

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/tuzi007a/article/details/96512115

Error: Can not find the main method in the class ConstructorTest1, set the main method is defined as:
public static void main (String [] args)
otherwise JavaFX application class must extend javafx.application.Application

As a white, first I encountered this problem today. I drop mom yeah this is Shaya, can not do anything just started killing me, I thought the program was wrong, various test various checks and found nothing wrong. So I checked some articles, find the following solutions.
This problem occurs because in the same folder, there are keyword-named files such String.java.
Here Insert Picture DescriptionIt is like that. Then delete the file. It will be OK. This problem will be solved.
Since then, I remember, you do not save the class file after the keyword. . .

Guess you like

Origin blog.csdn.net/tuzi007a/article/details/96512115