I tried java --version
in the command line and I get :
Unrecognized option: --version Error: Could not create the Java virtual machine Error: A fatal exception has occurred. Program will exit.
Everything was working fine until I installed jre 7 (I had jdk 1.6 preinstalled ) So, I uninstalled the previous versions, restarted and then installed fresh jdk 7u5 windows i586.
Still I get the same problem. Can anyone help me with this?
I am unable to install and run maven for this reason.
when trying to run the java command, this means that there is no java command on your shell's command search path. The cause could be: you don't have a Java JRE or JDK installed at all, you have not updated the PATH environment variable (correctly) in your shell initialization file, or.
The Java is not recognized as an internal or external command in Command Prompt error occurs if the environment variables are not configured correctly. By adding the correct path to an environment variable, you can resolve the issue. If the error persists, try installing the compatible Java version.
You used two -
marks. Try with one: java -version
.
Update: Since Java 9 java
and javac
commands support both --version
and -version
.
java -version
This is the command to get the current installed version info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With