

{"id":108929,"date":"2022-07-26T10:00:47","date_gmt":"2022-07-26T04:30:47","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=108929"},"modified":"2026-06-03T16:58:33","modified_gmt":"2026-06-03T11:28:33","slug":"verify-java-version","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/verify-java-version\/","title":{"rendered":"Verify Java Version in Windows, Linux and Mac"},"content":{"rendered":"<p>Java was introduced in 1995 by Sun Microsystems. Since then, it has been a widely used programming language among programmers around the world. Java receives frequent updates to improve its quality and introduce new features. It is important to verify if we have the latest version of Java running on our computer or not. In this article, we will take a look at various methods to check and verify the version of Java running on our computer across all the Operating Systems.<\/p>\n<h3>What is the Java Version?<\/h3>\n<p>Java consists of many different components which build up the complete programming language. The Java Runtime Environment (JRE) consists of Java Virtual Machine(JVM) libraries and other files, and all of them together form the Java Development Kit(JDK). With each update, each of these files is changed or improved. Together, they form the Java version. Each of Java\u2019s components has a separate build number and version.<\/p>\n<h3>Why Is Java Updated?<\/h3>\n<p>Java is a popular programming language that is regularly updated to enhance its security, stability, and performance. These updates are necessary for several reasons:<\/p>\n<ul>\n<li><strong>Security<\/strong>: Java updates frequently patch security vulnerabilities. Outdated Java versions can be exploited by malicious actors to gain unauthorized access to your system or steal sensitive information. Keeping Java up to date significantly reduces this risk.<\/li>\n<li><strong>Performance<\/strong>: Java updates may include performance improvements that can make your Java programs run faster and more efficiently.<\/li>\n<li><strong>New Features:<\/strong> New Java updates introduce new functionalities and features that you can leverage in your applications.<\/li>\n<li><strong>Bug Fixes:<\/strong> Updates often include fixes for bugs that could be causing problems in your Java programs.<\/li>\n<\/ul>\n<h3>Java Version verification on Windows:<\/h3>\n<p>In Windows, there are four ways to verify the Java version, they are as follows:<br \/>\n1. Using Command Prompt.<br \/>\n2. Using Control Panel<br \/>\n3. Using Java System Class.<br \/>\n4. Using the Directories Method.<\/p>\n<h4>Verify Java Version Using Command Prompt:<\/h4>\n<p>1. Open Command Prompt from the search or type cmd in the Run application.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/open-command-prompt.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108932\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/open-command-prompt.webp\" alt=\"open command prompt\" width=\"567\" height=\"335\" \/><\/a><\/p>\n<p>2. In command prompt, type java -version, this will show the proper version and release of java the computer is running.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/type-command-in-prompt.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108933\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/type-command-in-prompt.webp\" alt=\"type command in prompt\" width=\"1920\" height=\"1080\" \/><\/a><\/p>\n<h4>Java Version Verification Using Control Panel:<\/h4>\n<p>1. Open the control panel from the Start menu or desktop.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/open-control-panel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108934\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/open-control-panel.webp\" alt=\"open control panel\" width=\"1920\" height=\"1032\" \/><\/a><\/p>\n<p>2. From the Control panel, click on Programs<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/programs-on-control-panel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108935\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/programs-on-control-panel.webp\" alt=\"programs on control panel\" width=\"1920\" height=\"1032\" \/><\/a><\/p>\n<p>3. Click on Java<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-in-control-panel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108936\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-in-control-panel.webp\" alt=\"java in control panel\" width=\"1920\" height=\"1030\" \/><\/a><\/p>\n<p>4. Click on about, this will show all the information regarding java on the computer<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/about-on-control-panel.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108937\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/about-on-control-panel.webp\" alt=\"about on control panel\" width=\"1920\" height=\"1032\" \/><\/a><\/p>\n<h4>Verify java Version Using Java System Class:<\/h4>\n<p>In the Java system class, there is a function getProperty() that verifies the version of the Java JRE. The function accepts a key as an argument. The key is the name of the system property. The syntax of the method is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">public static String getProperty (String Key)<\/pre>\n<p>The function returns a string value or null if there is no property with that key. It throws a NullPointerException when there is a null key and an IllegalArgumentException when there is an empty key.<\/p>\n<p><strong>Program to check Java Version:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.DataFlair.Verify;\r\npublic class JavaVerify\r\n{\r\n    public static void main(String args[])  \r\n        {   \r\n             System.out.println(\"Java Version for this Computer is: \"+System.getProperty(\"java.version\"));  \r\n        }  \r\n}\r\n<\/pre>\n<p><strong>The output of the above Program:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-system-class-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108938\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-system-class-output.webp\" alt=\"java system class output\" width=\"1920\" height=\"1032\" \/><\/a><\/p>\n<h4>Java version verification using the Directory Method:<\/h4>\n<p>This is the simplest way to check the Java version. In this method, we simply type About Java in the start menu. It will take us to an application that will show the Java Version.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/directory-method-cropped.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108939\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/directory-method-cropped.webp\" alt=\"directory method cropped\" width=\"372\" height=\"311\" \/><\/a><\/p>\n<h3>Java Version verification on Linux:<\/h3>\n<p>In Linux, we can check the Java version through the terminal. We have to write java -version and it will give the version and build number.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/Linux-Terminal-Version-check.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108940\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/Linux-Terminal-Version-check.webp\" alt=\"Linux Terminal Version check\" width=\"1919\" height=\"1080\" \/><\/a><\/p>\n<h3>Java Version verification on Mac:<\/h3>\n<h4>1. Through Terminal<\/h4>\n<p>Like Linux, in mac also, we can check the java version by typing java -version in the terminal.<\/p>\n<h4>2. Through System Preference<\/h4>\n<p>Follow the steps below to verify the Java version on Mac through System Preferences:<\/p>\n<p>1: Click on the Apple logo on the upper left side of the screen.<br \/>\n2: Click on System Preferences<br \/>\n3: Launch Java Control Panel from the Java Icon.<br \/>\n4: Click on the General Tab from the Java Control Panel.<br \/>\n5: Click About. This will show the Java version you are currently running.<\/p>\n<h4>3. Through README.md<\/h4>\n<p>Press the Command button along with the spacebar. A pop-up will open showing the README.md file. This file will contain the details about the Java version of your system.<\/p>\n<h3>Java Version Verification Through Web<\/h3>\n<p>We can check the Java version present on the computer through the Oracle website. It will uninstall the older version of Java and install the newer version if any.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-web-verify.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-108941\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/java-web-verify.webp\" alt=\"java web verify\" width=\"1920\" height=\"976\" \/><\/a><\/p>\n<p><strong>Note:<\/strong> We should not confuse the JDK version and JRE version. The terminal of Windows shows the JDK version, and the system class shows the JRE version.<\/p>\n<p>Both of them together, along with other components, make up Java. All the detailed information about the latest versions of each component can be found on the official Java website by Oracle.<\/p>\n<h3>Additional Tips:<\/h3>\n<ul>\n<li>It&#8217;s recommended to uninstall older versions of Java before installing a newer version.<\/li>\n<li>Be aware of the difference between JDK (Java Development Kit) and JRE (Java Runtime Environment). The command prompt on Windows might show the JDK version, while the Java system class typically shows the JRE version. Both JDK and JRE, along with other components, contribute to the overall Java version.<\/li>\n<li>You can find the latest Java version and detailed information about each component on the official Oracle Java website.<\/li>\n<\/ul>\n<h3>Conclusion:<\/h3>\n<p>In this article, we saw why it is important to keep Java up to date and how to verify which version of Java we have. There are different ways to check the version; all of them are listed above in the article.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java was introduced in 1995 by Sun Microsystems. Since then, it has been a widely used programming language among programmers around the world. Java receives frequent updates to improve its quality and introduce new&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":108930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[26816,26819,26818,26817],"class_list":["post-108929","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-verify-java-version","tag-verify-java-version-on-linux","tag-verify-java-version-on-mac","tag-verify-java-version-on-windows"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Verify Java Version in Windows, Linux and Mac - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn how to verify java version on windows, Linux &amp; Mac. For windows, ways are Using Command Prompt, Control Panel, Java System Class, etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/verify-java-version\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Verify Java Version in Windows, Linux and Mac - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn how to verify java version on windows, Linux &amp; Mac. For windows, ways are Using Command Prompt, Control Panel, Java System Class, etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/verify-java-version\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-26T04:30:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T11:28:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Verify Java Version in Windows, Linux and Mac - DataFlair","description":"Learn how to verify java version on windows, Linux & Mac. For windows, ways are Using Command Prompt, Control Panel, Java System Class, etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/verify-java-version\/","og_locale":"en_US","og_type":"article","og_title":"Verify Java Version in Windows, Linux and Mac - DataFlair","og_description":"Learn how to verify java version on windows, Linux & Mac. For windows, ways are Using Command Prompt, Control Panel, Java System Class, etc.","og_url":"https:\/\/data-flair.training\/blogs\/verify-java-version\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-07-26T04:30:47+00:00","article_modified_time":"2026-06-03T11:28:33+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Verify Java Version in Windows, Linux and Mac","datePublished":"2022-07-26T04:30:47+00:00","dateModified":"2026-06-03T11:28:33+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/"},"wordCount":900,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp","keywords":["Verify Java Version","Verify Java Version on linux","Verify Java Version on mac","Verify Java Version on windows"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/verify-java-version\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/","url":"https:\/\/data-flair.training\/blogs\/verify-java-version\/","name":"Verify Java Version in Windows, Linux and Mac - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp","datePublished":"2022-07-26T04:30:47+00:00","dateModified":"2026-06-03T11:28:33+00:00","description":"Learn how to verify java version on windows, Linux & Mac. For windows, ways are Using Command Prompt, Control Panel, Java System Class, etc.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/verify-java-version\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/04\/verify-java-version-in-windows-linux-mac.webp","width":1200,"height":628,"caption":"verify java version in windows linux mac"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/verify-java-version\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Verify Java Version in Windows, Linux and Mac"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=108929"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108929\/revisions"}],"predecessor-version":[{"id":148763,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/108929\/revisions\/148763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/108930"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=108929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=108929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=108929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}