Linux 配置多JDK环境

DONG HAO
2023-02-21 / 0 评论 / 339 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2023年02月21日,已超过774天没有更新,若内容或图片失效,请留言反馈。

下载多个版本的JDK

https://www.oracle.com/java/technologies/downloads/#java11

解压到/usr/lib目录

我安装了3个版本JDK

/usr/lib/jdk1.8.0_281
/usr/lib/jdk-11.0.11
/usr/lib/jdk-17.0.6-10

分别注册环境

alternatives --install /usr/bin/java java /usr/lib/jdk1.8.0_281/bin/java 8
alternatives --install /usr/bin/java java /usr/lib/jdk-11.0.11/bin/java 11
alternatives --install /usr/bin/java java /usr/lib/jdk-17.0.6-10/bin/java 17

刷新配置

update-alternatives --config java
source /etc/profile    
java -version
0

评论 (0)

OωO
  • ::(呵呵)
  • ::(哈哈)
  • ::(吐舌)
  • ::(太开心)
  • ::(笑眼)
  • ::(花心)
  • ::(小乖)
  • ::(乖)
  • ::(捂嘴笑)
  • ::(滑稽)
  • ::(你懂的)
  • ::(不高兴)
  • ::(怒)
  • ::(汗)
  • ::(黑线)
  • ::(泪)
  • ::(真棒)
  • ::(喷)
  • ::(惊哭)
  • ::(阴险)
  • ::(鄙视)
  • ::(酷)
  • ::(啊)
  • ::(狂汗)
  • ::(what)
  • ::(疑问)
  • ::(酸爽)
  • ::(呀咩爹)
  • ::(委屈)
  • ::(惊讶)
  • ::(睡觉)
  • ::(笑尿)
  • ::(挖鼻)
  • ::(吐)
  • ::(犀利)
  • ::(小红脸)
  • ::(懒得理)
  • ::(勉强)
  • ::(爱心)
  • ::(心碎)
  • ::(玫瑰)
  • ::(礼物)
  • ::(彩虹)
  • ::(太阳)
  • ::(星星月亮)
  • ::(钱币)
  • ::(茶杯)
  • ::(蛋糕)
  • ::(大拇指)
  • ::(胜利)
  • ::(haha)
  • ::(OK)
  • ::(沙发)
  • ::(手纸)
  • ::(香蕉)
  • ::(便便)
  • ::(药丸)
  • ::(红领巾)
  • ::(蜡烛)
  • ::(音乐)
  • ::(灯泡)
  • ::(开心)
  • ::(钱)
  • ::(咦)
  • ::(呼)
  • ::(冷)
  • ::(生气)
  • ::(弱)
  • ::(狗头)
泡泡
阿鲁
颜文字
取消