Home> Java> JavaBase> body text

What command do you need to use to compile a java program?

王林
Release: 2020-07-09 13:33:59
Original
25837 people have browsed it

To compile a java program, you need to use the javac command. The usage method is: 1. Open the command prompt and enter the directory where the Java file is located; 2. Execute the [javac file name.java] command and press Enter. At this time, a class file will be generated in the directory where the Java file is located.

What command do you need to use to compile a java program?

#You need to use the javac command to compile a java program.

(Recommended learning:java introductory program)

Related introduction:

How to compile a java program through the javac command?

1. Open cmd and enter the folder where the .Java file is located.

Since my source files are in the JAVA folder of the D drive, I need to enter the D drive first (enter d: Enter)

What command do you need to use to compile a java program?

2 , enter the D drive, and then enter the JAVA folder. After enteringcd JAVA, press the Enter key.

What command do you need to use to compile a java program?

3. Enter thejavac random.javacommand and press the Enter key to compile the program.

What command do you need to use to compile a java program?

(Video tutorial recommendation:java video tutorial)

The compilation is completed. You can see that a .class file is generated in the directory where the .java file is stored.

What command do you need to use to compile a java program?

4. At this time, execute thejava randomcommand to run the program.

What command do you need to use to compile a java program?

The above is the detailed content of What command do you need to use to compile a java program?. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!