open the "edit the system environment variables". then click on "environment variables".
Under "User variables" click on "Path" then "Edit".
Find your Java path and click "Edit".
then paste the path of your java installation folder. Mostly you can find it on a path similar to this. C:\Program Files\Java\jdk-12.0.2\bin
Then click OK. now in the start menu, type cmd. open the command prompt. type java -version If you did it right,it should show something like this.