Linux下安装JDK与查找默认安装路径-开发工具论坛-社区热门-侠隐阁源码

Linux下安装JDK与查找默认安装路径

图片[1]-Linux下安装JDK与查找默认安装路径-开发工具论坛-社区热门-侠隐阁源码

1.安装命令

yum install java-1.8.0-openjdk.x86_64

2.确认是否安装JDK

java -version

3.查找java命令的位置

which java
[root@a]# which java
/usr/bin/java

4.java命令的位置所对于的软链地址

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

5.通过软链地址查找JDK的安装目录

ls -l /etc/alternatives/java
[root@a]# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 73 Jun 29 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

6.总结所以安装目录为: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/java

请登录后发表评论

    没有回复内容

一键隐藏
一键变装
站长简历