安装linux自带jdk

17 篇文章 0 订阅

如安装Java 1.8
yum install java-1.8.0-openjdk.x86_64 -y
安装完成后,可能会缺一些命令,如jps
需要在安装yum install -y java-1.8.0-openjdk-devel.x86_64

[root@centos01 ~]# yum list | grep jdk-devel
java-1.8.0-openjdk-devel.x86_64             1:1.8.0.242.b08-0.el7_7    @updates 
java-1.6.0-openjdk-devel.x86_64             1:1.6.0.41-1.13.13.1.el7_3 base     
java-1.7.0-openjdk-devel.x86_64             1:1.7.0.251-2.6.21.0.el7_7 updates  
java-1.8.0-openjdk-devel.i686               1:1.8.0.242.b08-0.el7_7    updates  
java-1.8.0-openjdk-devel-debug.i686         1:1.8.0.242.b08-0.el7_7    updates  
java-1.8.0-openjdk-devel-debug.x86_64       1:1.8.0.242.b08-0.el7_7    updates  
java-11-openjdk-devel.i686                  1:11.0.6.10-1.el7_7        updates  
java-11-openjdk-devel.x86_64                1:11.0.6.10-1.el7_7        updates  
java-11-openjdk-devel-debug.i686            1:11.0.6.10-1.el7_7        updates  
java-11-openjdk-devel-debug.x86_64          1:11.0.6.10-1.el7_7        updates 

然后,jps命令可以正常执行了

[root@centos01 ~]# jps -l
8106 sun.tools.jps.Jps

查看Linux自带的jdk安装路径

[root@centos01 ~]# whereis java
java: /usr/bin/java /usr/lib/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
[root@centos01 ~]# 
[root@centos01 ~]# ll /usr/bin/java
lrwxrwxrwx. 1 root root 22 Mar  5 00:30 /usr/bin/java -> /etc/alternatives/java
[root@centos01 ~]# 
[root@centos01 ~]# ll /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 Mar  5 00:30 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java

参考链接并感谢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值