I. Setting of environment variables
After installing the JDK, you need to configure the environment variables to find my Computer-Properties-advanced-environment variables
Here you need to configure 3 environment variables
1, the new system variable Java_home, the variable value is the JDK installation path, such as C:\Program files\java\jdk1.7.0_51
2. Create or modify the system variable path (Windows is case-insensitive), add%java_home%\bin after the value of the variable;
Note: You do not have to set the CLASSPATH variable , As long as your JDK is above version 1.4, the JRE automatically searches for class files in the current directory, and with Java's compile and run tools, the system can automatically load the Java classes in the Dt.jar and Tools.jar files. So you actually just need to add the JDK Bin directory to the path variable to run the Java program O (╯-╰) o, lazy to create a new java_home, directly to the path to copy the line down.
Ii. Common DOS commands
1, dir (displays the file name under the current directory)
2, c/d/e/f: (Directly into the c/d/e/f disk, the case can be written)
3. MD (Make directory create directory)
MD Mydir (Create folder in current directory Mydir)
MD MYDIR\MYDIR2 (Create Mydir2 subfolder under Folder Mydir).
4, CD (change the current directory, followed by the path, two special paths. and., respectively, the current directory and the previous level of the directory)
CD + Drive letter (displays the current directory of the disk) For example: CD d:/c:
CD + path (change current directory to path) CD USERS/AAA
5. Copy source file name target file name (copy the contents of the original file to the target files)
Format: Copy [source disk] [path] (source file name) [Target disk] [path] [target file name]
Note: (1) old files with the same file name on the target disk will be replaced.
(2) file name allows the use of wildcards */?, you can copy multiple files at the same time (* represents any text,? Represents a single character)
(3) If the target file name is the same as the source file name, the target file name can be omitted, if different.
(4) Copy [source disk] [path] (source file name 1) (source file name 2) (source file name 4) [Target disk] [path] [target file name] This enables file merging.
6, xcopy (Directory Copy command, you can copy the specified directory files and directory structure, but cannot copy hidden files and system files)
Format: [Source disk] (source path name) [Target drive] [target path][/s][/v][/e]
Description: (1)/s copy all files under the source directory and its subdirectories (if no/E, empty directories are not copied)
(2)/E together with an empty directory
7. Type (Displays the ASCII code text file content, the file name must have the extension)
Type Mytext.txt
8. del (delete file)
followed by a file pathname, you can use the wildcard character
9. Tree (shows disk directory structure)
The followed path shows the directory structure under that path, and the structure under the current directory is not followed by the path.
10. Echo (write content, create file)
Echo abc>a.txt (Create text file A.txt and write ABC).
Java program running mechanism Java source file (. java)--bytecode file (. Class)--machine code The first conversion is performed by Javac, and the second transformation is done by the JVM (Java Virtual machine), JDK, JRE, JVMJDK, Full name Java SE Development Kit,java Standard Development Package JRE, full name Java Runtime Environment,java Runtime environment JVM, full name Java Virtual machine, The Java Virtual machine JRE contains the JVM and other environment support for running Java programs, and after the JDK is installed, it contains the following directories in the JDKJDK path: storage of JDK commands, such as common Javac, Java and other commands Db:java DB Path JRE:JRE Environment lib:jdk Tool command Actual execution program Src:java all core class library source code
Java Learning Diary-1 setting Java environment variables, etc.