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

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) 
主站蜘蛛池模板: 金华市| 龙游县| 怀仁县| 静乐县| 浦北县| 凤山县| 醴陵市| 鹤山市| 邵东县| 宿迁市| 繁峙县| 平凉市| 瑞丽市| 临沧市| 正阳县| 宝山区| 五原县| 武威市| 临澧县| 杭锦旗| 东方市| 金门县| 志丹县| 珠海市| 河北区| 大竹县| 交口县| 隆回县| 布尔津县| 和田市| 玉屏| 大新县| 墨竹工卡县| 阳谷县| 墨江| 龙岩市| 金堂县| 扎鲁特旗| 万安县| 南雄市| 通山县|