Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Check Java Version on Linux System - DesignLinux

Sep 13 2020
designlinux 0 Comments
How to Check Java Version

Java is most popular programming language. It is used for building different kinds of cross-platform applications. This guide shows you how to check the version of Java installed on your Linux system.

Java Version Format#

Java uses semantic versioning. When looking at the version number, there are usually three digits to read:

MAJOR.MINOR.SECURITY

For example, in Java 11.0.8, 11 is major version, 0 is a minor version, and 8 is a security version.

  • MAJOR – Its for new features and functions.
  • MINOR – It indicates bug fixes and compatible improvements.
  • SECURITY – It contains the security fixes.

How to Check Java Version in Linux#

To check which version is installed on your system, open terminal on your system and run the java --version or java -V command:

java --version

In output, it will print default Java version of your system. On this system it’s 11.0.8. It may be different version on your system.

If you got error message like “java: command not found”, that means the Java is not installed on your Linux system. To install the Java on your Linux system visit appropriate link as per your operating system:

  • Install Java on Ubuntu
  • How to Install Java on Debian
  • Install Java on CentoS

To check if your system have multiple versions of Java installed, run below command:

 sudo update-alternatives --config java

If your machine have multiple Java version installed it should show something like below:

There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      manual mode
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

Press <enter> to keep the current choice[*], or type selection number:

Otherwise, it should show as following if there is only one version is installed:

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-11-openjdk-amd64/bin/java
Nothing to configure.

Conclusion#

In this article explained how to check the Java version using java --version command.

If you have any question or suggestion, please leave a comment below.

Related

Tags: java, terminal

How to Install and Configure Fail2ban on CentOS 8

Prev Post

W Command in Linux

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 83
  • 605,833

DesignLinux.com © All rights reserved

Go to mobile version