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.
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 613,471 times.
Is this article up to date?
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:
Java is one of the most widely used programming languages, and knowing your installed Java version is essential for ensuring compatibility with applications and development environments. This guide will walk you through various methods to check your Java version on different operating systems.
Table of Contents
1. Checking Java Version on Windows
Using Command Prompt
1. Press Win + R
to open the Run dialog.
2. Type cmd
and press Enter to open the Command Prompt.
3. In the Command Prompt, type the following command and press Enter:
java -version
4. The installed Java version will be displayed. For example:
Using Windows Settings (For Installed JDKs)
- Open the Start Menu and type “Environment Variables”.
- Click on “Edit the system environment variables.”
- In the System Properties window, click on the “Environment Variables” button.
- Under “System Variables,” check the
JAVA_HOME
variable, which typically points to the Java installation directory. - Navigate to the directory, and check the version in the
release
file.
2. Checking Java Version on macOS
Using Terminal
1. Open the Terminal application. You can find it in Applications > Utilities or search for “Terminal” in Spotlight.
2. In the Terminal, type the following command and press Enter:
java -version
3. The installed Java version will be displayed. For example:
java version “11.0.15” 2022-04-19 LTS
Java(TM) SE Runtime Environment (build 11.0.15+10-LTS-191)
Java HotSpot(TM) 64-Bit Server VM (build 11.0.15+10-LTS-191, mixed mode)
3. Checking Java Version on Linux
Using Terminal
1. Open your terminal application.
2. Type the following command and press Enter:
java -version
3. The installed Java version will be displayed. For example:
openjdk version “1.8.0_352”
OpenJDK Runtime Environment (build 1.8.0_352-b08)
OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)
Using Package Manager
For Debian-based systems (Ubuntu):
dpkg –list | grep -i jdk
For Red Hat-based systems (Fedora, CentOS):
rpm -qa | grep -i jdk
4. Alternative Methods to Check Java Version
Using an IDE
If you are using an Integrated Development Environment (IDE) like IntelliJ IDEA, Eclipse, or NetBeans:
- Open your IDE.
- Navigate to the settings or project configuration.
- Check the configured JDK version, which usually corresponds to the installed Java version.
Common Issues and Solutions
- Command Not Found:
- If the
java
command is not recognized, Java may not be installed or properly added to the system’s PATH environment variable. Ensure you install Java and configure the PATH.
- If the
- Multiple Versions Installed:
- Use the
which java
(Linux/macOS) orwhere java
(Windows) command to locate the executable being used.
- Use the
- JAVA_HOME Not Set:
- Setting the
JAVA_HOME
environment variable can help tools and scripts locate your Java installation.
- Setting the
Conclusion
Checking your Java version is a simple yet important task for developers and users who work with Java-based applications. Whether you use the command line, settings, or an IDE, ensuring you have the correct version installed can save time and prevent compatibility issues. Follow the steps above based on your operating system to verify your Java installation quickly.
Некоторые программы могут требовать наличия определенной версии Java на компьютере, причем иногда требуется Java RE (Runtime Environment) для запуска программ, иногда — JDK Development Kit для использования в целях разработки.
В этой простой инструкции подробно о способах определить версию Java на компьютере с Windows 11, 10 или другой версией ОС.
Окно «About Java»
Этот метод подойдёт для определения текущей версии Java Runtime Environment, служащей для запуска ПО, разработанного с использованием Java. Достаточно выполнить следующие шаги:
- В поиске на панели задач Windows начать набирать «Java», затем выбрать «About Java» в списке результатов.
- Посмотреть текущую версию Java в открывшемся окне.
Этот же пункт можно найти в папке «Java» в списке программ меню «Пуск».
Учитывайте, что «About Java» может отсутствовать в случае, если на вашем компьютере установлены только компоненты JDK, но не JRE.
Командная строка и PowerShell
Определение версии Java возможно с помощью командной строки или консоли Windows PowerShell (Терминала Windows):
- Запустите командную строку, PowerShell или Терминал Windows — для этого можно использовать контекстное меню кнопки «Пуск» или поиск в панели задач.
- Введите команду
java -version
и нажмите Enter.
- В результате вы увидите информацию о версиях компонентов Java. Учитывайте, что результат выполнения команды будет отличаться, в зависимости от того, Java Runtime Environment или Java Development Kit установлены на компьютере: в первом случае номер версии будет начинаться с цифры 1, после чего будет следовать версия JRE, во втором вы увидите точную версию JDK, как это можно увидеть на скриншоте ниже.
Другие способы
Несколько дополнительных способов проверки версии Java:
- При установке Java для запуска программ (JRE) в Панели управления появится одноименный пункт. Если открыть его, а затем нажать «About» на вкладке «General», вы увидите информацию о версии.
- Можно открыть расположение файла java.exe на компьютере, после чего посмотреть свойства этого файла, чтобы увидеть его версию:
И в завершение информация об официальных сайтах для загрузки Java последних версий:
- Java Runtime Environment для запуска программ
- JDK Development Kit (java SE) для разработки
Если у вас остаются вопросы, касающиеся установленной версии Java на компьютере, вы можете задать их в комментариях ниже, я постараюсь подсказать.