Check Java version from Command Line

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

  1. Gabriel9999

    Gabriel9999 MDL Novice

    Mar 11, 2019
    37
    5
    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

    Oct 15, 2014
    867
    1,388
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ddhd

    ddhd MDL Novice

    May 15, 2020
    1
    0
    0
    lol this guy