There are two ways to do the thing but doing it with Command prompt would be the easiest way. To start with the Command prompt hit “cmd” in the search after clicking on start. Now enter the commandset path="PATHNAME"; eg: set path="c:\Program Files\Java\JDK\bin"; and hit enter it will set your path automatically. Now you are ready to run your first Java program.
Interesting artcile , by the way I have also shared my experience as How to set PATH for Java let me know how do you find it.