Java Basics/Lesson Fourth: Running the first Java program in Eclipse and the problem of not finding a class

Source: Internet
Author: User

2018-03-06

Running Java programs in eclipse

Step 1:

Open Java File

Open the Java file created in the command line Hello World directly: Helloworld.java

Step 2:

Run

Click the Green Run button to run directly
In Eclipse, the compilation process automatically executes the

Step 3:

Observing running results

Once the operation is successful, the console console interface will appear below
If the console console window cannot be found, use the following procedure to open the console window

Step 4:

Open the Console window

By default, the console window is open, and if you accidentally close it, you can open it in the following way:
menu, Window, Console, Show View

Problem

Sometimes there are problems, there are hello this class, and there is the main method, but the run will appear to be unable to find or load class Hello, or Class not Found exception.

This situation, there are many reasons, please follow the following method one by one troubleshooting

Cause 1-check automatically

Eclipse is automatically compiled after saving, but is built on the premise of a setting:
Menu-project-> Tick build automatically, if not checked, it will not automatically compile Hello.java into Hello.class

Reason 2-problems

Menu->window->show view->problems Show Problems page
This will show the current project error, and the project will not automatically compile the. java file if there is an error.

The error is that the package imported by the project does not exist and the practice of importing the package is as follows: Importing MYSQL-JDBC jar packages for projects

Java Basics/Lesson Fourth: Running the first Java program in Eclipse and the problem of not finding a class

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.