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

Java can't find the main method?

angryTom
Release: 2019-11-13 16:12:04
Original
10217 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template