Java Study Notes 1 -- configuration of JDK environment variables in window7, window7jdk
1. First download the Java installation kit
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Click Accept License Agreement and download it based on your operating system. The download is complete and installed in the C: \ Program Files (x86) directory.
2. Right-click Windows 7 system and choose "computer"> "Advanced System settings"> "environment variable ".
3. Configure Environment Variables
In "system variables", set three attributes: JAVA_HOME, Path, and ClassPath (Case Insensitive). If the attributes already exist, click "edit". If the attributes do not exist, click "new ".
① JAVA_HOME indicates the JDK installation path, that is, the path selected during installation. Click new. A dialog box is displayed. Enter JAVA_HOME for the variable name and enter C: \ Program Files (x86) for the variable value) \ Java \ jdk1.8.0 _ 40. This path contains lib, bin, jre, and other folders (it is best to set this variable, because tomcat, eclipse, and so on will be run later based on this variable ).
② Path specifies a Path list for searching executable files so that the system can identify java commands in any Path. Because Path already exists in system variables, click Edit, add % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin at the beginning. Remember to add a semicolon (;) at the end (;)
③ ClassPath is the classorlib path of the java load class. Only the class in classpath can be identified by the java command and set :.; % Java_Home % \ bin; % Java_Home % \ lib \ dt. jar; % Java_Home % \ lib \ tools. jar (the beginning must contain. it indicates the current path) In fact, % JAVA_HOME % refers to reference the previously specified JAVA_HOME;
4. test whether the configuration is successful.
Start to Enter cmd, and enter the commands "java-version", "java", and "javac". If a screen is displayed, the environment variable is successfully configured.
If 'javac' is not an internal or external command, or a program or batch file that can be run. This error indicates that the Java environment variable configuration has failed. Check it carefully!