Newyorkcity
V2EX  ›  问与答

请问除了以下方法还有法子找出我的 centos 上 Java 安在哪儿了么...

  •  
  •   Newyorkcity · May 30, 2019 · 1675 views
    This topic created in 2721 days ago, the information mentioned may be changed or developed.


    谢谢!
    5 replies  •  2019-05-30 15:13:14 +08:00
    MLawliet
    MLawliet
    May 30, 2019 via Android❤️2
    1
    which java
    Aresxue
    Aresxue
    May 30, 2019
    2
    1.java -version;
    2.which java;
    3.rpm -qa|grep java
    4.yum list installed|grep java
    qwerthhusn
    qwerthhusn
    May 30, 2019
    3
    图上不都告诉你了???? `/usr/bin/java`只是一个连接,链接到的是`/etc/alternatives/java`,你再去`ll /etc/alternatives/java`啊
    jiejiss
    jiejiss
    May 30, 2019
    4
    赞同 #1
    暴力法:find / | grep java
    c4f36e5766583218
    c4f36e5766583218
    May 30, 2019
    5
    which java|xargs ls -l // 接着 ls -l 直到找到文件
    sudo find / -name "java" -type f 2>/dev/null|xargs file // 可能会找出多个 java,需要你自行判断哪个是当前环境的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2284 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:45 · PVG 21:45 · LAX 05:45 · JFK 08:45
    ♥ Do have faith in what you're doing.