http://blog.csdn.net/Jerry_Mining/article/details/71077853
1 下载对应版本的安装包
2 解压后复制到 usr/lib/jvm/目录下
tar -xzvf jdk-8u131-linux-i586.gz
sudo mv jdk1.8.0_131 /usr/lib/jvm/jdk1.8.0_131
3 更新jdk
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_131/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.8.0_131/bin/javac 1
根据提示输入相应的数字
sudo update-alternatives --config java
sudo update-alternatives --config javac
4配置java_home变量
$echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386
$ sudo echo export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_131/" >> ~/.bashrc
$source~/.bashrc
$echo
$JAVA_HOME
$source /etc/profile
网友评论