Last Updated :
29 Oct, 2020
Java is a programming language that is platform-independent, popular, simple, secure, and statically typed. Before discussing let’s clear Java language needs a runtime platform so before going ahead let’s clear how java is present on the machine.
Java language comprises three components mainly:
- Java Development Kit
- Java Runtime Environment
- Java Virtual Machine
Runtime Concepts than only we will check whether Java is there on the Platform (Operating System + Architecture)
1. Java Virtual Machine
This is a machine–specific software which is responsible for byte code on that machine and converts it into machine-specific instructions.
JVM is different for Windows JVM is different for Linux JVM is different for Different Platforms
So as a programmer we don’t need to check presence on the machine as it is pre-installed in the machine. It is responsible for running Java code line by line.
2. Java Runtime Environment
It is simply a package that provides an environment to only run our java code on the machine. No development takes place here because of the absence of developmental tools.
3. Java Development Kit
It is also a package that provides an environment to develop and execute where JRE is a part of it along with developmental tools.
- JDK = JRE + Developmental Tools
- JRE = JVM + Library Classes
Now, The first and Foremost step is to check the Java Development Kit in Windows which is also known as JDK. There are lots of versions of Java. Depending upon the operating system methods there are several methods to find the version of Installed JAVA on your Machine:
Let us discuss 3 standard methods in Windows
- User needs to open Command Prompt and enter- ‘java -version’
- Open control panel and lookup for Java
- Directories method- Click the Menu ‘Start’ and typing About.java or readme file
Taking one by one, showcasing in-depth individually
1. Command Prompt
The CMD (Command Interpreter is a command-line Interface. It supports a set of commands and utilities; and has its own programming language for writing batch files. Open CMD and search java -version. First, we have to an environment variable to the installed path location of the java folder. Otherwise, it will show invalid command. It is called ‘Terminal’ in the case of mac operating systems.
java -version // CMD/Terminal command to check java version on the machine
In the case of Windows OS: It is showing java is installed on the machine with version 1.8.0 (See carefully at line number 5)
“1.8.0_144” is the version of the java
In the case of macOS: It is showing java is installed on the machine with version 14.0.1 ( see carefully at line number 2)
Second Method:
- Open Control Panel and there is an option of the java on the interface of the control panel
- Click on the java option and click about a small pop window will appear
In the case of Windows:
In the case of Mac: Click on the Java icon downside. System preferences in mac are the same as the Control panel in Windows.
Third Method:
Search Program and features in the control panel and search JAVA Named option
In the case of Windows: Simply custom search- About Java
In the case of Mac:
Press the command button followed by a spacebar without lifting fingers from the command button.
A popup box will appear for less than a second followed by another pop-up as shown below:
Download Article
Download Article
- Windows 10 & 11
- Using Windows 8, 7, and XP
- Fix the «Java is Not Recognized» Error
- Expert Q&A
- Tips
|
|
|
|
Do you need to check if the latest version of Java is installed on your Windows PC? An easy way to see if Java is up to date is to type a quick command at the Windows command prompt. No matter which version of Windows you’re using, you can type «java -version» into the command prompt (cmd) to see the version number of your Java installation. This wikiHow article will teach you how to use the command prompt to find out which version of Java (or the Java compiler) is installed on Windows 10, 11, and earlier versions.
How to Find Your Java Version in Command
Open Command Prompt, type java -version, then press Enter. This will print out the current version of Java that you’re running, as well as the build number.
-
It’s the icon with Windows logo. By default, it’s in the bottom-left corner of the taskbar.
- You can also press the Windows key to open the Start menu.
-
This displays the Command Prompt icon at the top of the search results. [1]
Advertisement
-
It’s the black square icon with a small white «C:\» in the upper-right corner.
-
Once you run this command, you’ll see the Java version next to «java version» on the first line.
- To check the version of the Java compiler, use javac -version.
- If you see an error that says «‘java is not recognized as an internal or external command, operable program or batch file,» Java is either not installed or not properly added to your path. Add Java to your system path to fix the error.
Advertisement
-
It’s the icon with the Windows logo. By default, it’s in the lower-left corner. Right-clicking this icon displays the System menu above the Start button.[2]
-
It’s the third option from the bottom of the System menu. This opens the «Run» program.
-
Use the space next to «Open» in the Run program to type the command to open the Command Prompt.[3]
-
You’ll see the currently installed version of Java next to «java version.»
- To check the version of the Java compiler, use javac -version.
- If you see an error that says «‘java is not recognized as an internal or external command, operable program or batch file,» Java is either not installed or not properly added to your path. Add Java to your system path to fix the error.
Advertisement
-
If you’ve installed Java but you’re unable to check the version from the command line, you might just need to add the Java path to your system environment variables. But first, you’ll need to figure out where Java is installed:
- First, press Windows key + S and type java. If there are no results on your computer, you will need to install Java, which you can download from https://www.oracle.com/java/technologies/downloads.
- If Java is installed, right-click the Start menu and select File Explorer.
- Locate the Java installation directory, which will look something like this (depending on your version): C:\Program Files\Java. If you don’t see a Java installation directory in C:\Program Files, look in C:\Program Files(x86)\Java or C:\Java.
- Open the folder number containing the most recent version number for JRE or the JDK, e.g. C:\Program Files\Java\jdk17.0.4.1 or C:\Program Files\Java\ jdk1.8.X_XXX.
- Highlight the full path to the current folder at the top of File explorer and press Ctrl + C to copy.
-
[4]
- On Windows 11, 10, and 8, press Windows key + S, type View advanced system settings, then click Advanced System Settings.
- On Windows 7, right-click My Computer, click Properties, then click Advanced.
-
You’ll see this near the bottom-right corner of the window.[5]
-
This is the bottom section. Adding a new item to System variables instead of User variables ensures that the Java path will be correct for all users on this PC, not just your own user account.
-
Create this variable name based on whether you installed the Java Development Kit or the Java Runtime Environment.[6]
-
You can do this by right-clicking the bottom field and selecting Paste.[7]
-
Now that you’ve added Java to your path, you can successfully check your Java version from the command prompt. Just close the open command prompt window, open a new one, then run java -v to find your version.
Advertisement
Add New Question
-
Question
How do I check my version of Java with the command prompt?
Yaffet Meshesha is a Computer Specialist and the Founder of Techy, a full-service computer pickup, repair, and delivery service. With over eight years of experience, Yaffet specializes in computer repairs and technical support. Techy has been featured on TechCrunch and Time.
Computer Specialist
Expert Answer
Open Command Prompt, type java -version, then press Enter. This will print out the current version of Java that you’re running, as well as the build number.
-
Question
How do I set java path?
Hrithik Nitish
Community Answer
To check version from Windows command prompt, at first you have to download Java and then save the Java bin file address to Windows environment variable and than you have to open Command Prompt and enter Java where you have installed the Java version.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
-
If you want to remove an older version of Java, try the Java Uninstall Tool for Windows.[8]
This simple tool displays all currently installed versions of Java and gives you the option to delete old unneeded versions. Visit https://www.java.com/en/download/uninstalltool.jsp and click I agree to the Terms and Want to Continue to launch the tool. -
You can also check your Java version in the Java Control Panel app, which you’ll find in the Start menu. Just click About in Java Control Panel to view the version number.[9]
-
The easiest way to update Java is to click the Update tab on the Java Control Panel app and select Update Now.
Thanks for submitting a tip for review!
Advertisement
References
About This Article
Article SummaryX
1. Click the Windows Start icon.
2. Type cmd to display the Command Prompt icon in the Start menu.
3. Click on the Command Prompt icon.
4. Type java -version in the Command Prompt.
5. Press Enter.
Did this summary help you?
Thanks to all authors for creating a page that has been read 614,195 times.
Is this article up to date?
Java remains the second-most popular coding language in the world according to the PYPL Index, and it ranks third among skilled professionals to develop high-performance applications across multiple platforms — only C and Python score higher.
As a result, you’ll often find Java running in the background of many Mac or Windows systems. However, if the version of Java you have isn’t up to date, applications may not work as intended — or may refuse to open at all.
In this piece, we’ll walk you through how to check your Java version in Mac and Windows to make sure the Java you’ve got is the one you need.
When it comes to Windows, there are two easy ways to check your Java version:
-
Check the Java Version Using the Control Panel
-
Check the Java Version Using the Command Line
If you’re a Mac user, you’ve also got two simple options:
-
Check the Java Version Using System Preferences
-
Check the Java Version Using the Terminal
Let’s break down each method in more detail.
How to Check Java Version in Windows
1. Check the Java Version Using the Control Panel
If you’re a Windows user, the Control Panel approach is quick and easy.
First, click on the magnifying glass icon at the bottom-left of your desktop.
Next, type in “About Java” in the search bar that appears, then click on the “About Java” app that appears. If it doesn’t come up, try “Configure Java”. If you’re still having no luck, you probably don’t have Java installed.
Once you click through on About Java or Configure Java, you’ll see a pop-up window indicating the current version and build number.
2. Check the Java Version Using the Command Line
You can also check your Java version in Windows using the command line.
First, click on the magnifying glass and type “cmd”, then click on the Command Line app icon that appears.
Now, enter the command java -version and you’ll see the version of Java listed.
The video below not only covers these two common methods but an additional third method as well.
How to Check Java Version in Mac
1. Check the Java Version Using System Preferences
To check your Java version on a Mac without leaving the GUI, start by clicking the Apple icon in the top left-hand corner of your screen, then select “System Preferences.”
Next, find and click on the Java icon in the list of programs shown.
Finally, click on the “About” button to see the version of Java you’re currently running.
2. Check the Java Version Using the Terminal
Checking your Java version on Mac using the terminal is similar to using the Windows command line.
First, find and click on the spotlight search bar in the top-right corner of your screen, then type in “terminal” and click on the terminal icon.
This will bring up the command line. From here, you enter the same command as in Windows, java -version to get your current version details.
Worth noting? On both Windows and Mac devices, you can use the command javac -version to check the version of your primary Java compiler. This video can show you how:
Checking Your Java Version
And there you have it: Four simple ways to quickly check your Java version and make sure you’ve got the newest, freshest Java served up and ready to go.
Java is an object-oriented and platform-independent programming language developed by Sun Microsystems. The compiled Java code runs on all platforms that support Java without the need for recompilation.
The following text elaborates on how to check the Java version on Windows.
Prerequisites
- A system running Windows (this tutorial uses Windows 11).
- Access to the command prompt.
- Java installed.
How to Check Java Version on Windows?
There are two ways to check the Java version on Windows. You can use the GUI (via the Windows Control Panel) or the command prompt. The following text shows how to use both methods.
Option 1: Check Java Version on Windows Using GUI
To find the Java version on your Windows via GUI, use the Control Panel. Follow these steps:
1. Open the Windows menu and type control panel in the search bar.
2. Find the Control Panel in the search results and click the icon to open it.
3. Open the Programs option.
4. Find and click the Java icon.
5. Once the settings open, click the About button.
6. The About Java window appears and displays the Java version on your computer.
Option 2: Check Java Version on Windows Using Command Line
Another option to find the Java version on Windows is through the command line. Follow these steps:
1. Open the Windows Start menu and type cmd in the search bar.
2. Open the Command Prompt once it appears in the search results.
3. Type the following command:
java -version
The output displays the Java version installed on your Windows system.
Conclusion
This article explained how to check the version of Java installed on a Windows system using a GUI or command prompt.
Next, learn more about Java Platform and Java EE.
Was this article helpful?
YesNo