Linux安装JDK详细步骤
linux安装jdk详细步骤:\
1.上官网下载jdk压缩包
网址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
利用lRZ工具上传到服务器
3.解压 jdk-8u171-linux-x64.tar.gz 安装包
4.配置环境变量 vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_171 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
5.执行profile文件 source /etc/profile
使配置文件生效
6.检查新安装的jdk java -version
结果如下
java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
tar -zxvf jdk-8u171-linux-x64.tar.gz -C /usr/local/java