一,安装jdk1.8.0.144
下载地址:www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
Ubuntu配置jdk运行环境
export HADOOP_HOME=/usr/local/hadoop
export CLASSPATH=$($HADOOP_HOME/bin/hadoop classpath):$CLASSPATH
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
$ mkdir /usr/lib/jvm #创建jvm文件夹
$ sudo tar zxvf jdk-7u80-linux-x64.tar.gz -C /usr/lib #/ 解压到/usr/lib/jvm目录下
$ cd /usr/lib/jvm #进入该目录
$ mv jdk1.7.0_80 java #重命名为java
$ sudo apt-get install vim
$ vim ~/.bashrc #给JDK配置环境变量
~/.bashrc文件末尾添加以下内容
export JAVA_HOME=/usr/lib/jvm/java
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
$ source ~/.bashrc #使新配置的环境变量生效
$ java -version