The first is to use a Linux-brought Yum tool, such as the Yum search JDK, to search the JDK software, choose the search itself, and install it for your own software version. Like yum install java-1.7.0-openjdk.x86_64
The second way is to download the installation of their own official website. Specific as follows:
1. The following required version of the official website, such as 32-bit, or 64-bit Linux version.
2. Select the installation location, such as/usr/jdk/. If not, you can create a new directory
3. Unzip the downloaded file, for example: TAR-ZXVF jdk-7u45-linux-x64.tar.gz
4. Configure environment variables, here are two ways to configure
A. In the/etc/profile file configuration, valid for the global, that is, all users are valid, vim/etc/profic, Add the following content:
Export java_home=/usr/j DK /jdk1.7.0_45
export path= $PATH: $JAVA _home/bin
B. Or in the ~/.BASHRC file configuration, only valid for the current user, add the same content, as above
5.source/etc/profile or source ~/.BASHRC make it effective
6. See if the installation succeeded Java-version. Javac Detecting whether a compilation environment is installed
Installing JDK under Linux