Installation of the JDK environment variable, record it so that it is easy to forget to look, mainly the installation and environment variable configuration under Windows and Ubuntu system
JDK Download: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Download the JDK for the corresponding system
First, install the JDK Configuration Environment under window:
Installation is simple, choose to store the directory on the line, basically always next.
To configure environment variables:
In the system environment, configure the following:
New Java_home
C:\Program files\java\jdk1.7.0_67 (corresponding installed directory)
New CLASSPATH
.; %java_home%\lib;%java_home%\lib\tools.jar
Edit path Add (suffix add; number)
%java_home%\bin;%java_home%\jre\bin
In the cmd command, enter: java-version If the version information appears, the configuration is successful.
Second, the Linux system Ubuntu installation JDK configuration environment:
Download the Linux version of the JDK to the download directory
1. Create the JVM directory and extract the downloaded compressed files to the JVM and rename them to the Java folder
$ sudo MKDIR/USR/LIB/JVM
$ sudo tar zxvf jdk-8u25-linux-i586.tar.gz-c/USR/LIB/JVM
$ CD/USR/LIB/JVM
$ sudo mv jdk1.8.0_25 Java
2. Add an environment variable (~ represents the root directory of the current user)
$ sudo vi ~/.BASHRC
Add the following environment variable configuration content in the tail line:
Export Java_home=/usr/lib/jvm/java
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH
3. Configuring JDK Version Command information
sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/java/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/java/bin/javac 300
sudo update-alternatives--install/usr/bin/jar Jar/usr/lib/jvm/java/bin/jar 300
sudo update-alternatives--install/usr/bin/javah javah/usr/lib/jvm/java/bin/javah 300
sudo update-alternatives--install/usr/bin/javap JAVAP/USR/LIB/JVM/JAVA/BIN/JAVAP 300
To perform the installation:
sudo update-alternatives--config java
4. Test whether the installation was successful:
$ java-version
Install JDK configuration environment variables under windows and Ubuntu