Newyorkcity
V2EX  ›  问与答

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

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


    谢谢!
    5 replies    2019-05-30 15:13:14 +08:00
    MLawliet
        1
    MLawliet  
       May 30, 2019 via Android   ❤️ 2
    which java
    Aresxue
        2
    Aresxue  
       May 30, 2019
    1.java -version;
    2.which java;
    3.rpm -qa|grep java
    4.yum list installed|grep java
    qwerthhusn
        3
    qwerthhusn  
       May 30, 2019
    图上不都告诉你了???? `/usr/bin/java`只是一个连接,链接到的是`/etc/alternatives/java`,你再去`ll /etc/alternatives/java`啊
    jiejiss
        4
    jiejiss  
       May 30, 2019
    赞同 #1
    暴力法:find / | grep java
    c4f36e5766583218
        5
    c4f36e5766583218  
       May 30, 2019
    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   ·   Solana   ·   4495 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 01:05 · PVG 09:05 · LAX 18:05 · JFK 21:05
    ♥ Do have faith in what you're doing.