Home > Development Tools > VSCode > How to write the first java program when using vscode for the first time

How to write the first java program when using vscode for the first time

王林
Release: 2019-12-06 09:34:20
Original
8625 people have browsed it

How to write the first java program when using vscode for the first time

Preparation work:

1. Install extension

How to write the first java program when using vscode for the first time

2. Configure java path

File in the upper left corner-"Preferences-"Settings Open setting.json, add java.home

How to write the first java program when using vscode for the first time

Finally restart Can.

The first java program

1. Create a file named hello.java

2. Write a program, such as:

public class hello{
    public static void main(String[] args) {
        System.out.println("helloworld");
    }
}
Copy after login

Note: The file name and class name must be consistent.

3. Press F5 to run the program

Output result:

helloworld
Copy after login

The first program is completed!

More related tutorial recommendations: vscode tutorial

The above is the detailed content of How to write the first java program when using vscode for the first time. 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