Error when i try to run java -version

Look at this error i am getting when i try to run java -version yet when i run javac and javac -version, i am successful.

@mozzy @gcliff

First of all you need to add the jdk path not JRE like C:\Program Files\Java\jdk1.8.0_171 to the environment variables, I see you have the JRE there make sure to check that.

Also probably because that path is wrong should be as above in JAVA_HOME and in the path within the environment variables, this is if you are running windows

@amosalimpa on top of what @odorajonathan has said, did you attempt to re-install the jdk again on a different drive other than originally on drive C ?

@amosalimpa which operating system are you running??

Good morning my great dears, @herbert24, i am running WINDOWS 10.

Dear @gcliff , sorry to ask, which other drive, for example, other than drve C could you be meaning?

@gcliff, because i didn’t re-install anything. What i had installed is the one i was configuring.

According to what @gcliff meant, you machine comes with two main drives drive C and drive D for the case of windows machine where am also working with too, So when you install any software from internet , you have rights to change the installation to your drive choice, But for your case now, you probably need your jdk installation in C-drive for simplicity of development

Thanks dear @sharif yeah, it was saved on drive C.

Good can you go ahead and paste your jdk location configuration in c-drive like how @odorajonathan stated above

Let me do dear, @sharif

Greetings, kindly advise me on how to UNINSTALL this JDK and reinstall afresh for my attempts have met no success at all. Do you anyway advise me to go ahead and UNINSTALL it?? @dkayiwa @odorajonathan, @sharif, @gcliff ,@herbert24

Paste here your jdk location just follow @odorajonathan convention, uninstalling it and install it again wont make you success, ok share your screen shot of your jdk version that you installed

Here it is.

Now your downloaded jdk is in download folder, Now you should add your jdk into class Path