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 Overflowyou 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.
You need to update your Windows path to include your %JAVA_HOME%\bin directory. %JAVA_HOME% is the directory that you installed Java into and is also an environment variable that you need to configure for command line execution of your applications. You can edit both of these in the Windows control panel and you should restart.
When you run java -version you will see the internal version number. This is explained here: https://en.wikipedia.org/wiki/Java_version_history.
Basically, you can ignore the 1. when reading version number. The _xxx is a reference to the most recent patch or build release.
Check Java version from Command Line
How can I see all installed Java versions?
CMD does not recognize the java -version command?
Can anyone tell me how to check JDK version? Not Java Version. JDK
Videos
I have a Java installation and I have only access via bash. How can I check the Java version from command line.
This should work. This assumes it’s installed in a directory that’s included in $PATH which isn’t always the case with Java. Some programs ship with their own version of Java specific to their application so you’ll first have to determine where it’s installed.
java --version
When I write "java --version" in the command line I only get one java version, which just happens to be the one in the environment variables. However I know that I have at least two versions installed, because I had to install an old version in order for some program to work. How does this stuff work? Thanks in advance
The simplest way is:
update-java-alternatives -l shows you all the Java versions you have installed.
java -version shows you the Java version you are using.
java -showversion shows you the Java version you are using and help.
Normally it would be OpenJDK.
This command should tell you what is currently providing the Java virtual machine (java) and the Java compiler (javac):
file /etc/alternatives/java /etc/alternatives/javac
This assumes the "alternatives" system is working properly, which might not be the case, depending on how Java has been "messed up" in the past. To check this, run:
file `which java javac`
If the alternatives system is working correctly and being used by Java, then you should see:
/usr/bin/java: symbolic link to `/etc/alternatives/java'
/usr/bin/javac: symbolic link to `/etc/alternatives/javac'
Otherwise please edit your question to provide details. Then it should be possible to give a more specific answer.
You can remove openjdk-6 with the Software Center. There are multiple packages associated with it, so you may need to remove more than one packages. (All the `openjdk-6 packages are listed here.)
Or you can use the command-line:
sudo apt-get remove openjdk-6-\* icedtea-6-\*
However, whichever method you use, you may want to check first to see what depends on these packages--you might have software installed that specifically needs version 6. (Probably not, but possibly.)
You can check for this by simulating the removal operation on the command-line:
apt-get -s remove openjdk-6-\* icedtea-6-\*
This will show you the effects of removing those packages, including what other packages would be removed as well. (You'll notice that since this is a simulation, you don't need sudo.)
If you want to be able to continue using Java content online in your web browser (this is not the same thing as JavaScript), then before you remove any icedtea-6- or openjdk-6- packages (except perhaps openjdk-6-jdk), you should make sure you have icedtea-7- packages installed corresponding to whatever icedtea-6- packages are installed.
The short answer: yes, your JRE is new enough.
The longer answer: you can get the precise version string from your installed JRE by opening a command window, cding to your JRE's binaries folder, and doing java -version. For example, on my laptop I do
C:\Program Files (x86)\Java\jre7\bin>java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
This is JRE 1.7.0 update 51, or just 'Java 7 update 51'.
You're using JRE 6, so the folder will be a bit different, but it shouldn't be too hard to find.
You can check your java version by opening a command prompt and type java -version.

You can download and install the latest version of java:
- 32bit: http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383
- 64bit: http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385
Note: Windows 7 does not always map the java bin path. If you get an error when typing java -version then you can manually set your java path (see below)

Then either restart your machine or copy the entire contents from step 4. Open a command prompt and type set path=, right click and select paste. Press enter to run. You should then be able to type java -version.
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.