Common tools in the bin directory under the JDK installation directory:
1. compilation tool
Javac
2. Running tools
Java
3. compression tools
Jar
4. Document generation tools
Javadoc
5. character encoding and conversion tools
Native2ascii
1. Compile the command:
1. Compile a file
Under the directory, enter javac a. java
Compile multiple files (using spaces in the middle ):
(1) javac a. java B. java c. java
(2) javac *. java
(3) create the sourcefiles.txt file, add the name of the file to be compiled, one line, and run javac @sourcefiles.txt.
2. Place the generated compilation file in a separate folder.
Javac-d cls a. java (put the generated compilation files in the cls folder in the same directory. This directory can be modified, using the directory path relative to a. java)
3. Compile a class that depends on other classes
Javac-classpath cl-d cls a. java (use the class under the cl directory and put the compilation file under the cls file)
Ii. run commands
Java my. hello (a compilation file under my package)
Java-classpath cl my. java
Note: When writing a package, you cannot run the file in the directory where the class file is located, but you can only write the file in the directory at the "upper level)
3. Compression commands (compress and decompress files or folders)
Jar-cvf Compression
Jar-xvf unzip
Example: jar-cvf hello. jar a. class B. class c. class (Compressed)
Jar-cvf lcz. jar lcz (compress the lcz folder in this directory and name it lcz. jar)
Jar-xvf cl \ hello. jar (decompress hello. jar in the cl directory)
Both pressurization and decompression are in the current directory by default.
Iv. Document generation tool compile command www.2cto.com
(Generate an HTML document from the doc help file in the source file)
Javadoc hello. java
Javadoc-d java \ doc-version-author lcz \ src \ lcz. java
V. character encoding and conversion tools
Native2ascii-encoding: name after the original file name is changed
Author: wusahaoshuai