search
HomeJavaJavaBaseJava can't find the main method?

Java can't find the main method?

Nov 13, 2019 pm 04:12 PM
javamainnot found

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools