【Linux】Linux下查找JDK默认安装路径

一、查找效果图

 

 

二、查找步骤

1、首先确认是否已按照JDK
java -version

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)

2、然后查找java命令的位置

which java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# which java
/usr/bin/java

3、查找java命令的位置所对于的软链地址

ls -l /usr/bin/java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Jun 18 15:45 /usr/bin/java -> /etc/alternatives/java

4.最后通过软链地址查找JDK的安装目录

ls -l /etc/alternatives/java

[root@iZ2ze3zda3caeyx6pn7c5zZ base-eureka]# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Jun 18 15:45 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/java

 

转载于:https://www.cnblogs.com/756623607-zhang/p/11442320.html

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页