标签:
CentOS7 Java安装
执行如下命令
java -version
yum remove java-1.7.0-openjdk
上传RPM文件到/tmp目录下
cd /tmp
rpm -ivh jdk-8u31-linux-x64.rpm
在/etc/profile.d目录下新建java.sh
#!/bin/bash
JAVA_HOME=/usr/java/default
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib
export PATH JAVA_HOME
export CLASSPATH
并赋予执行权限
chmod +x /etc/profile.d/java.sh
source /etc/profile.d/java.sh
查接连接
ls -la /usr/bin/java
ls -la /usr/bin/javac
ls -la /usr/bin/javadoc
ls -la /usr/bin/javaws
ls -la /usr/bin/jcontrol
更新连接
ln -sf $JAVA_HOME/bin/java /usr/bin/java
ln -sf $JAVA_HOME/bin/javac /usr/bin/javac
ln -sf $JAVA_HOME/bin/javadoc /usr/bin/javadoc
ln -sf $JAVA_HOME/bin/javaws /usr/bin/javaws
ln -sf $JAVA_HOME/bin/jcontrol /usr/bin/jcontrol
标签:
原文地址:http://www.cnblogs.com/tjpanda88/p/4296402.html