Common DOS commands
- Dir (directory): Lists the files and folders in the current directory
- mkdir (make directory): Creating a Directory
- RD (remove directory): Delete directory
- CD (change directory) changes the specified directory (enter the specified directory)
- Del (delete): Delete files, delete a bunch of suffix names like files *.txt
- Move: Moving files
- -classpath: The location of the specified point
- CLS: (Clear screen) clear
- -D: Search
Example: ( . refers to the current directory; .. refer to the top level directory)
CD://Return to top level directory
Java-classpath "c:/;D:/;." Pk1.my//point to C, D drives and current directory
Javac-d "." Todaynews.java//Search but todaynews under the previous directory and compile
Extended
1. How to open the command window:
①. Windows + R
②. Directly under the corresponding folder, SHIFT + right, select "Open Command Window Here"
2. Compiling, running
Compile the program (. java file) to generate a. class file (take Binary.java as an example). After the build succeeds and runs the program. (-D refers to a search, ".") Refers to the current directory)
The Javac compiler takes a class as a unit and each class class is translated into a bytecode file that is a. class file.
Javac-d "." Binary.java//Compiling programs
Java Binary//Run Program
3. Java configuration on cmd
Java-version
4. Package as a. jar file (7.20 is a packaged folder, test is the name of the packaged file)
Jar CVF Test.jar 7.20/
5.classpath function, value, how to specify;
Classpath tells JVN where to load bytecode files. There are two types of values.
How to specify CLASSPATH:
The ① directory and library file (jar) can specify values for the JVM through the-CP,-classpath parameter options.
② can be specified by environment variable Classpath
Summary of basic Java Basics-----Common DOS commands (i)