suse12sp1环境下安装jdk-1.8.0

xiaoxiao2021-03-01  21

1.下载jdk-1.8.0 http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html 2.上传到/tmp下 3.在/usr/local/新建java目录 mkdir -p /usr/local/java/ 1. tar -xvf /tmp/jdk-1.8.0 -C /usr/local/java/ 2. 设置环境变量

vi /etc/profile # set environment JAVA_HOME=/usr/java/jdk1.7 #这里要根据自己创建的java路径做相应的修改,不可盲目粘贴复制 CLASSPATH=$JAVA_HOME/lib/ PATH=$PATH:$JAVA_HOME/bin export PATH JAVA_HOME CLASSPATH

3.刷新环境变量

source /etc/profile

4.验证java是否成功

java -version

5.成功后显示

bogon:/usr/local/java # java -version java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
转载请注明原文地址: https://www.6miu.com/read-4049972.html

最新回复(0)