1. PATH environment variable. The role is to specifyCommand search path(Javac/Java/javadoc)When executing a command under shell, it will go to the path specified by the PATH variable to check whether the corresponding command can be foundProgram. We need to add the bin directory under the JDK installation directory to the existing PATH variable. The bin directory contains frequently used executable files such as javac/Java/javadoc waiting, after setting the PATH variable, you canAny directoryAnd java.
2. classpath environment variable. The role is to specifyClass search pathTo use the classes that have already been compiled, the premise is that you can find them. JVM uses classpth to find classes. We need to set DT. jar and tools. jar in the Lib subdirectory under the JDK installation directory to classpath. Of course, the current directory "." must also be added to this variable. (Therefore, when you need to import a class, you will have settings on classpath. You can find the class name to import in the path)
3. java_home environment variable. It points to the JDK installation directory, Eclipse/netbeans/TomcatThe software is to find and use the installed JDK by searching the java_home variable.