After JDK is installed successfully, check whether the installation is successful. Enter "java-version" in the command prompt and press the Enter key. If the following version information is displayed:
Java version "1.6.0 _ 26"
Java (TM) SE Runtime Environment (build 1.6.0 _ 26-b03)
Java HotSpot (TM) Client VM (build between 1-b02, mixed mode, sharing)
Indicates that JDK has been installed successfully.
The following describes how to set Java environment variables.
1. Open my computer -- properties -- Advanced -- Environment Variables
2. Create System variables JAVA_HOME and CLASSPATH
Variable name: JAVA_HOME
Variable value: C: Program FilesJavajdk1.7.0
Variable name: CLASSPATH
Variable value:.; % JAVA_HOME % libdt. jar; % JAVA_HOME % libtools. jar;
3. select the environment variable named "Path" in "system variables" and double-click the variable to add the absolute Path of the bin directory in the JDK installation Path to the value of the Path variable, separate them with semicolons (;) and existing paths.
Variable name: Path
Variable value: % JAVA_HOME % bin; % JAVA_HOME % jrebin;
Finally, test whether the environment variable is successfully configured. You can enter "javac" in the command line window and press Enter. The output help information indicates that the configuration is correct.