tar -zxvf jdk-7u55-linux-i586.tar.gz
步骤二:解压jdk-7u55-linux-i586.tar.gz ,执行以下命令:
#mkdir /usr/local/java/
#tar xzvf jdk-7u55-linux-i586.tar.gz #cp -R jdk1.7.0_55 /usr/localjava/ #vi /etc/profile
步骤三:设置环境变量,在环境变量文件最后加入以下内容:
export JAVA_HOME=/usr/local/java/jdk1.7.0_55 export ANDROID_JAVA_HOME=$JAVA_HOME export JRE_HOME=/usr/local/java/jdk1.7.0_55/jreexport CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
步骤四:执行java -version命令,验证jdk是否安装成功:
java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b13) Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)