you might need to add path in environment variables which you can find in Control Panel open the Jdk where you installed and add until /bin in the path in environment variables.

Add until /bin in path variable in System Variables which is residing in Environment Variables.

Then do java -version which might show up.

If still problem persists, try restarting your pc and see.

Answer from ganga on Stack Overflow
🌐
Oracle
java.com › en › download › help › version_manual.html
How to find Java version in Windows or Mac - Manual method
Type the following in a Terminal window: /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version · When launching a Java application through the command line, the system uses the default JDK.
Discussions

CMD shows nothing when putting 'java -version'
After you install Java you have to set up your PATH environment variable to include the JDK. This tells Windows where to look whenever you're trying to execute java or javac. To do this in windows just type Environment Variables into your start menu. Go into it, double click on PATH to open it, scroll to the end, put in a semi-colon and the path to your JDK. Then re-launch CMD (you have to close and reopen the window) and you should be able to do Java --version and get a response. More on reddit.com
🌐 r/javahelp
5
3
February 14, 2022
CMD does not recognize the java -version command?
But what's in PATH though? Remove old Java directories from this variable and keep only the right one, better to write just "${JAVA_HOME}/bin" instead of full paths More on reddit.com
🌐 r/javahelp
13
0
August 15, 2025
Check Java version from Command Line
I have a Java installation and I have only access via bash. How can I check the Java version from command line. More on community.spiceworks.com
🌐 community.spiceworks.com
6
5
May 28, 2020
How can I see all installed Java versions?
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/javahelp
7
1
December 15, 2021
🌐
Wikihow
wikihow.com › computers and electronics › software › programming › java › how to check your java version in the windows command line
How to Check Your Java Version in the Windows Command Line
February 24, 2025 - 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 ...
🌐
HubSpot
blog.hubspot.com › home › website › how to check your java version in windows & mac
How to Check Your Java Version in Windows & Mac
February 27, 2025 - Now, enter the command java -version and you’ll see the version of Java listed.
🌐
Princeton CS
introcs.cs.princeton.edu › java › 15inout › windows-cmd.html
Java and the Windows Command Prompt
Prepend C:\Program Files\Java\jdk1.6.0_27\bin; to the beginning of the PATH variable. Click OK three times. You will type commands in an application called the Command Prompt. Launch the command prompt via All Programs -> Accessories -> Command Prompt. (If you already had a command prompt window open, close it and launch a new one.) You should see the command prompt; it will look something like: Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation.
Find elsewhere
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check java version on windows
How to Check Java Version on Windows | Knowledge Base by phoenixNAP
December 22, 2025 - 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.
🌐
Prospera Soft
prosperasoft.com › blog › full-stack › backend › java › checking-java-version-in-cmd-a-step-by-step-guide
Check Java Version in CMD: Easy Guide
Once the Command Prompt is open, type 'java -version' and hit enter. This command prompts your system to display the installed Java version.
🌐
Itview
itview.in › blog › java › how-to-check-java-version-in-cmd-a-quick-and-easy-guide
How to Check Java Version in CMD: A Quick and Easy Guide
January 23, 2025 - For Windows: Press Windows + R, type cmd, and hit Enter. This will open the Command Prompt window. Once the Command Prompt is open, type the following command: ... After typing this command, press Enter.
🌐
How-To Geek
howtogeek.com › home › windows › how to check your java version on windows 10
How to Check Your Java Version on Windows 10
January 8, 2024 - If you want to check your Java version in a command-line interface, open Command Prompt or PowerShell, then enter "java -version" in the console.
🌐
Reddit
reddit.com › r/javahelp › cmd shows nothing when putting 'java -version'
r/javahelp on Reddit: CMD shows nothing when putting 'java -version'
February 14, 2022 -

Hi,i have been having problems with java, so i started to investigate if java was working properly.

When executing the command, i don't get anything, i have searched and i can't find anything, only solutions when it appears that the command is not recognized, but nothing comes up for me.

http://prntscr.com/26vq5jv

Anyone knows the solution?

Top answer
1 of 4
3
After you install Java you have to set up your PATH environment variable to include the JDK. This tells Windows where to look whenever you're trying to execute java or javac. To do this in windows just type Environment Variables into your start menu. Go into it, double click on PATH to open it, scroll to the end, put in a semi-colon and the path to your JDK. Then re-launch CMD (you have to close and reopen the window) and you should be able to do Java --version and get a response.
2 of 4
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
Reddit
reddit.com › r/javahelp › cmd does not recognize the java -version command?
r/javahelp on Reddit: CMD does not recognize the java -version command?
August 15, 2025 -

I downloaded the Java JDK 21 and JDK 8 from oracle.com and installed them in the folder C:\Program Files\Java\. I adjusted the environment variables accordingly:

  • Set JAVA_HOME as a system variable to C:\Program Files\Java\jdk-21.

  • Added the entries C:\Program Files\Java\jdk-21\bin and C:\Program Files\Java\jdk-8\bin to the Path.

I saved everything, restarted my PC, and ran CMD both normally and as an administrator. However, when I enter java -version, nothing happens – no version is displayed, and there’s no error message.

When I run where java, I get this:

  • C:\Program Files\Common Files\Oracle\Java\javapath\java.exe

  • C:\Program Files (x86)\Common Files\Oracle\Java\java8path\java.exe

  • C:\Program Files\Java\jdk-21\bin\java.exe

  • C:\Program Files\Java\jdk-8\bin\java.exe

echo %JAVA_HOME% returns C:\Program Files\Java\jdk-21 as expected.

I suspect the first two entries from where java might be leftovers from previous installations. Why doesn’t java -version work then?

Solution that worked for me:

Go to your Program Folder and deinstall eventhing that has to do with java. Search in your taskbar for java and delete everything that shows up. Clean your trash folder.

Install java again. Now it should work.

Top answer
1 of 5
2
But what's in PATH though? Remove old Java directories from this variable and keep only the right one, better to write just "${JAVA_HOME}/bin" instead of full paths
2 of 5
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
Hash It Out
hash-it-out.hashnode.dev › how-to-check-java-version-in-cmd-a-simple-guide
How to Check Java Version in CMD: Simple Steps for Windows Users
October 9, 2024 - Let’s go through the steps to check which version of Java is installed on your Windows computer. ... Press the Windows + R keys on your keyboard. This will open the "Run" window. 2. Type cmd in the box and press Enter. You can also search for “Command Prompt” in your Start menu.
🌐
javaspring
javaspring.net › blog › java-version-cmd
Java Version in Command Prompt: A Comprehensive Guide — javaspring.net
For example, 11.0.12 indicates major version 11, minor version 0, and patch version 12. The PATH environment variable is a system variable that contains a list of directories where the operating system looks for executable files. When you install the JDK, you need to add the bin directory of the JDK installation to the PATH environment variable so that you can run Java commands from the Command Prompt.
🌐
Linux.org
linux.org › home › forums › general linux forums › general linux topics
Check Java version from Command Line | Linux.org
May 28, 2020 - issues that come up with java usually ... return/enter button bash-5.0$ // just shows the bash prompt don't type that ... You can use the -version parameter for the java command like below....
🌐
Client Portal
service.emich.edu › TDClient › 30 › Portal › KB › ArticleDet
Article - Determine Java version on W...
You can quickly determine the default installed version of Java by issuing the java -version at the Windows command prompt. Applies to Windows 10/11 · Of particular interest to AppMan users · Click on the Start Menu · Type CMD and press Enter ...