1、下载32位JDK 后,由于文件是.zip,所以直接解压后将文件夹放到/opt/module下
2、将jdk-7u80-linux-x64.tar.gz解压到/opt/module下
root@easonl-Lenovo-IdeaPad-S400:/opt/software# ls
apache-hive-1.2.1-bin.tar.gz hadoop-2.7.2.tar.gz jdk-7u80-linux-x64.tar.gz
root@easonl-Lenovo-IdeaPad-S400:/opt/software# tar -zxvf jdk-7u80-linux-x64.tar.gz -C /opt/module/
3、配置环境变量
export JAVA_HOME=/opt/module/JDK1.8
export PATH=$PATH:$JAVA_HOME/bin
4、测试环境变量
t@easonl-Lenovo-IdeaPad-S400:/opt/module# source /etc/profile
root@easonl-Lenovo-IdeaPad-S400:/opt/module# java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~16.04-b08)
OpenJDK Server VM (build 25.282-b08, mixed mode)