问题
I have recently uninstalled JDK 11 and installed JDK 8. For confirmation, I want to check which JDK is installed on my Windows 10 machine. I typed java -version
on cmd then get the error message
java is not recognized as an internal or external command
Question: How to know which JDK version installed on pc?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/57363446/how-to-know-the-jdk-version-on-my-machine