Login http://www.oracle.com Download the JDK for the appropriate operating system and install it.
The JDK includes command tools (such as compilation) and JRE (Java Runtime Environment) necessary to compile the Java program.
The JRE includes the JVM (Java Virtual machine) and other class loaders, bytecode validators, and a large number of class libraries.
Java operating mechanism
The Java source file (*.java) is compiled into a bytecode file (*.class) via the compiler (Javac command),
The bytecode file (*.class) virtual machine (Java command) interprets the machine code that executes into a specific platform.
Set the PATH environment variable (the location of the command that tells the computer Java)
On the right-click menu of My Computer, clicking Properties, clicking Advanced, clicking Environment variables, editing path in the system variable, appending the environment variable value
D:\java\jdk1.7.0\bin; (Installation path).
Other:
You can create a new java_home in the user variable to tell your computer to use that version of the JDK. D:\java\jdk1.7.0;
CLASSPATH environment variable can not be added after JDK1.5, the system will run the class file under the current path.
This article is from "If life is just like the beginning" blog, please make sure to keep this source http://9944522.blog.51cto.com/9934522/1710482
Java Development Environment Building