Check Java version from Command Line

Discussion in 'Linux' started by Gabriel9999, May 28, 2020.

  1. Gabriel9999

    Gabriel9999 MDL Novice

    Joined:
    Mar 11, 2019
    Messages:
    37
    Likes Received:
    5
    Trophy Points:
    0
    I have a Java installation and I have only access via bash. How can I check the Java version from command line.
     
  2. John Sutherland

    John Sutherland MDL Addicted

    Joined:
    Oct 15, 2014
    Messages:
    836
    Likes Received:
    1,247
    Trophy Points:
    30
    Hello @ Gabriel9999 - Use the apt command to list installed packages in combination with the grep command to narrow down the list to a specific package.

    sudo apt list --installed | grep -i java

    -OR-

    You can use dpkg in a similar manner.

    sudo dpkg -l | grep -i java
     
  3. ddhd

    ddhd MDL Novice

    Joined:
    May 15, 2020
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    lol this guy
     
  4. samueltarcin9999

    samueltarcin9999 MDL Novice

    Joined:
    Mar 11, 2019
    Messages:
    37
    Likes Received:
    10
    Trophy Points:
    0