Home > Java > Javagetting Started > How to use java notepad

How to use java notepad

藏色散人
Release: 2020-04-11 09:08:01
Original
4933 people have browsed it

How to use java notepad

How to use java notepad?

Create a new document on the desktop, rename "HelloWorld", and change the txt suffix to "java".

Recommended tutorial: "java learning"

How to use java notepad

Edit the content of "HelloWorld.java":

public class HelloWorld {
    public static void main(String[] args)
        System.out.println("welcome to baidu!!!");
    }
}
Copy after login

Save the file and put it into the D drive (the path is optional).

Note: "System.out.println("xxx");" is the output statement, and "xxx" can be any other content.

How to use java notepad

Enter the "CMD" command in the start bar of the computer to open the DOS command line:

DOS command> D: (Press Enter to enter the root directory of the D drive )

DOS Command> dir (Press Enter to view the files in the current directory)

DOS Command> javac HelloWorld.java (Press Enter to compile the .java source file)

DOS command> java HelloWorld (Press Enter, load and run the .class bytecode file)

The content displays: welcome to baidu!!!

How to use java notepad

How to use java notepad

##Notes

You need to install the Java running tool JDK first.

Configure the environment variables required by the JDK.

The above is the detailed content of How to use java notepad. 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