官术网_书友最值得收藏!

Installing Java SDK 7

Perform the following steps to install the Java SDK 7 on your machine. You can also go with JDK 1.8:

  1. Download the Java SDK 7 RPM from Oracle's site (http://www.oracle.com/technetwork/java/javase/downloads/index.html).
  2. Install the Java jdk-7u<version>-linux-x64.rpm file on your CentOS machine using the following command:
sudo rpm -ivh jdk-7u<version>-linux-x64.rpm 
  1. Add the following environment variable in the ~/.bashrc file:
export JAVA_HOME=/usr/java/jdk<version>
  1. Add the path of the bin directory of the JDK to the PATH system environment variable to the ~/.bashrc file:
export PATH=$JAVA_HOME/bin:$PATH 
  1. Run the following command to reload the bashrc file on the current login terminal:
source ~/.bashrc
  1. Check the Java installation as follows:
java -version  

The output of the preceding command is as follows:

java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode) 
主站蜘蛛池模板: 德安县| 泰和县| 宁国市| 财经| 山东省| 延津县| 宁陕县| 大埔区| 沽源县| 柏乡县| 丘北县| 乌鲁木齐市| 西藏| 阿鲁科尔沁旗| 广水市| 襄樊市| 文登市| 宁海县| 西乌| 四会市| 莱西市| 宁远县| 简阳市| 塘沽区| 海城市| 尼木县| 忻城县| 吉水县| 江川县| 桃园市| 夏津县| 驻马店市| 定边县| 泰安市| 阳新县| 河西区| 定安县| 阿克苏市| 安义县| 都匀市| 石泉县|