记录一下Ubuntu 换jdk版本

参考:(21条消息) 【Linux下载安装jdk8】_kelekele111的博客-CSDN博客_jdk8 linux

 

1.下载对应的jdk linux压缩包jdk-8u5-linux-i586.tar.gz

2.在/usr/local 下解压

3.配置环境变量/etc/profile

export JAVA_HOME=/usr/local/jdk1.8.0_321 #jdk安装目录
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}

 whereis java

which java (java执行路径)

echo $JAVA_HOME

echo $PATH

参考:(21条消息) ubuntu 更换指定jdk版本,java -version没有变新jdk版问题_追梦青苹果的博客-CSDN博客

lrwxrwxrwx 1 root root 21 10月 28 2015 jar -> /etc/alternatives/jar
lrwxrwxrwx 1 root root 27 10月 28 2015 jarsigner -> /etc/alternatives/jarsigner
lrwxrwxrwx 1 root root 22 10月 28 2015 java.bak -> /etc/alternatives/java
lrwxrwxrwx 1 root root 23 10月 28 2015 javac.bak -> /etc/alternatives/javac
lrwxrwxrwx 1 root root 25 10月 28 2015 javadoc -> /etc/alternatives/javadoc
lrwxrwxrwx 1 root root 23 10月 28 2015 javah -> /etc/alternatives/javah
lrwxrwxrwx 1 root root 23 10月 28 2015 javap -> /etc/alternatives/javap
lrwxrwxrwx 1 root root 24 10月 28 2015 javaws -> /etc/alternatives/javaws
lrwxrwxrwx 1 root root 26 10月 28 2015 jconsole -> /etc/alternatives/jconsole
lrwxrwxrwx 1 root root 21 10月 28 2015 jdb -> /etc/alternatives/jdb
lrwxrwxrwx 1 root root 23 10月 28 2015 jexec -> /etc/alternatives/jexec
lrwxrwxrwx 1 root root 22 10月 28 2015 jhat -> /etc/alternatives/jhat
lrwxrwxrwx 1 root root 23 10月 28 2015 jinfo -> /etc/alternatives/jinfo
lrwxrwxrwx 1 root root 22 10月 28 2015 jmap -> /etc/alternatives/jmap
-rwxr-xr-x 1 root root 38600 3月 11 2016 join
lrwxrwxrwx 1 root root 21 10月 28 2015 jps -> /etc/alternatives/jps
lrwxrwxrwx 1 root root 28 10月 28 2015 jrunscript -> /etc/alternatives/jrunscript
lrwxrwxrwx 1 root root 27 10月 28 2015 jsadebugd -> /etc/alternatives/jsadebugd
-rwxr-xr-x 1 root root 3918 3月 2 2016 json_pp
lrwxrwxrwx 1 root root 24 10月 28 2015 jstack -> /etc/alternatives/jstack
lrwxrwxrwx 1 root root 23 10月 28 2015 jstat -> /etc/alternatives/jstat
lrwxrwxrwx 1 root root 24 10月 28 2015 jstatd -> /etc/alternatives/jstatd

 

把之前的软连接全要废掉

posted @ 2022-12-05 16:29  七君子风  阅读(89)  评论(0编辑  收藏  举报