Home  >  Article  >  Java  >  Java can't find the main method?

Java can't find the main method?

angryTom
angryTomOriginal
2019-11-13 16:12:0410171browse

Java can't find the main method?

java can’t find the main method?

When we use eclipse to write java programs, we will encounter such a problem:

Error: The main method cannot be found in the class. Please define the main method as public static void main(String[] args) Otherwise, the JavaFX application class must extend javafx.application.Application

Solution:

1. Check whether the main function has No spelling mistakes (sometimes I type mian too quickly on the keyboard).

2. Click on eclipse ->window->preference->run and debug->Lunching

Change the first line to always

Java cant find the main method?Run the code again to resolve the error.

php Chinese website, a large number of free Java introductory tutorials, welcome to learn online!

The above is the detailed content of Java can't find the main method?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What are java value typesNext article:What are java value types