(1) Under Windows7
1. Installing Java
First you need to download the Java SDK JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
Click the corresponding download button to start the download,install the JDK as prompted, and then continue installing the JRE.
Installing the JDK allows you to customize information such as the installation directory, such as selecting the installation directory:C:\Program files\java\jdk1.7.0 .
2. Configure Environment variables
After the installation is complete, click on My Computer, right button properties → " Advanced system settings"→ " environment variables"→ " system Variables" set the following three property values :
Variable name:java_home
Variable value:C:\Program files\java\jdk1.7.0
Variable name:Path
Variable value:%java_home%\bin;%java_home%\jre\bin;
Variable name:CLASSPATH
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; Remember, there's a "." in front.
This is the Java Environment configuration, which starts eclipse directly after the configuration is complete , andit automates the configuration of the Java environment.
Note: If you are using a 1.5 version of JDK, you can compile and run the Java program without setting the CLASSPATH environment variable .
3. Test If the JDK is installed successfully
1,"start"→"run", type "cmd";
2, type the command "Java-version", "Java", "Javac" several commands, appear screen, indicating that the environment variable configuration is successful;
Linux under the Java Development environment configuration to be supplemented.
Java Development Environment Configuration