Everyone configures environment variables are generally
Java_home:c:\program Files (x86) \java\jdk1.6.0_30;
Path:%java_home%\bin;
CLASSPATH:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar.
Explain:
Path points to the search command paths, and if you do not configure the path variable to point to the JDK, you will not be able to run Javac, Java and other commands at the command line.
Classpah points to the class search path,.; Indicates that in the current directory search, because Java programs are often used in the Lib directory under the Dt.jar and Tools.jar class, so these two also need to be added, if the command line compiled and run the program also need to use a third-party jar file, you also need to add a third-party jar file. Dt.jar and Tools.jar are not included in the Lib of the JRE.
Rt.jar is the Java base Class library (which contains the most commonly used java.*, javax.* packages, org.* packages), Dt.jar is about the runtime environment of the class library ( mainly swing package ), Tools.jar is the Tool class library ( including Javac,java,javap,javadoc and so on. JAVAP, the abbreviation for Java printer, is an anti-compilation tool that comes with the JDK.
About Java environment variables and those jar packages