Home > Java > javaTutorial > Example analysis of Java compiling and running in cmd

Example analysis of Java compiling and running in cmd

黄舟
Release: 2017-10-08 09:34:40
Original
1712 people have browsed it

Prevent you from forgetting it every time you use it

1. Enter the path where the .java file is located

(cls clear console command )

2.javac compile

javac -d . demo1.java

javac demo1.java

such as The compiled file has a package name, javac -d . demo1.java

.class file will be generated in the cn/itcast/path path of the current path

If it is javac demo1.java command, the generated .class file is in the same directory as .java

3 .Run

java cn.itcast.path.demo1

without suffix.

The above is the detailed content of Example analysis of Java compiling and running in cmd. 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