'java --version is not showing in command prompt

I have installed java on my machine. Everything is done like adding paths and all those.Also my java codes are running , but when i tried to check my java version using java -version or java --version in my cmd, then it is not showing anything. also where java shows C:\Program Files\Common Files\Oracle\Java\javapath\java.exe



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source