How to Check Current JDK Version installed in Your System Using CMD?17 Mar 2025 | 2 min read There are different versions of Java is available. Some of the applications generally require different version because of compatibility problems. In this section, we will learn how to check the Java version in Windows using CMD. A version string contains a version number optionally followed by pre-release and build information. The first number in Java version represents the major version and the second number represents the release. Java provides -version option to find the current Java version. There are following ways to find the Java version in Windows:
Note: Before checking the Java version, ensure that Java is installed and the path is properly set.Using Command PromptBy using the Command Prompt, we can easily find the Java version. The Java provides -version option to check the Java version. It prints the product version. To find the Java version in CMD, follow the steps given below: Step 1: Open the Command Prompt by pressing Windows Key + R, type cmd and press enter key or click on the Ok button. It opens the Command Prompt window. Step 2: Type the following command in the prompt window and press enter key. It shows the Java version. ![]() If the above command shows 'java' is not recognized, it means the path is not properly set. To resolve this problem, we must add the Java path to the system environment variable. Using Java System ClassAnother way to find the Java version is to use the System class. It provides the getProperty() method that finds the Java version. The getProperty() method accepts a key as an argument. A key is the name of the system property. Syntax: The method returns the String value of the system property, or null if there is no property with that key. It throws NullPointerException if the key is null and IllegalArgumentException if the key is empty. Let's find Java version through a program. FindJavaVersion.java Output: ![]() We can also find the Java version by using the Control Panel. Step 1: Open the Control Panel and click on the Java icon. It shows the Java Control Panel. ![]() Step 2: In the Java Control Panel, click on the About button. ![]() When we click on the About button, the About Java dialog box appears that shows the Java version. ![]() |
A beautiful path in graph theory refers to a path in a weighted graph that meets specific aesthetic criteria, such as minimal cost, minimal distance, or adherence to certain constraints like color or type of edges. Finding a beautiful path can be a common problem...
7 min read
In Java, a class expected error occurs when the compiler expects a class definition but encounters something else. It typically happens due to missing braces, incorrect syntax, or misplaced keywords. Ensuring proper class declarations, correct use of data types, and maintaining correct structure helps ent this...
7 min read
Java generics allow for defining classes, interfaces, and methods with type parameters, which increases type safety and reduces the need of using explicit type casting but has Some important limitations due to the design and implementation of generics. These restrictions are due to the fact...
13 min read
Correctly nesting brackets is a common problem in computer science, particularly with mathematical equations, interpreters, and compilers. If the sequence of the appropriate opening and closing parenthesis is preserved, a set of parentheses is considered "properly nested." Problem Statement Given a string containing only the characters ( and...
7 min read
Vending machines have become an integral part of our daily lives, offering a convenient way to access a variety of snacks and beverages. Behind their seemingly simple functionality lies a complex software design that ensures smooth user interactions and inventory management. In this section, we will...
7 min read
Heart Pattern is another complex pattern program that is rarely asked by the interviewers because of its complexity. We print two types of heart patterns, i.e., a simple heart and some text inside the heart. We take the help of the Math class and the lineSeparator() method...
6 min read
With the advent of multithreading and asynchronous programming, Java provides a potent method for task execution in parallel called the ExecutorService. However, you could encounter an ExecutionException when managing many threads and addressing errors that arise during task execution. In this section, we will examine the...
5 min read
? LINQ is known as Language Integrated Query, and it is presented in .NET 3.5 and Visual Studio 2008. The excellence of LINQ is it gives the capacity to .NET languages(like C#, VB.NET, and so forth) to create inquiries to recover information from the information source. For...
6 min read
In this section, we are going to learn about the Fenwick tree in Java. Fenwick tree is also called Binary Indexed Tree (BIT). Scenario Where Fenwick Tree is Used Let's understand in which scenario a segment tree comes in handy. Suppose, we have an array a[] = {0, 1,...
5 min read
The Java Keytool is a crucial utility in the Java Development Kit (JDK) that enables developers to manage cryptographic keys, certificates, and key stores. While using Keytool, developers may encounter various exceptions, one of which is the "keytool error: java.io.FileNotFoundException" exception. In this section, we will...
4 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India