Download the latest version of the Java JDK from ()
for windows
Double-click on the install file and it should open an installer
Click next, then accept the license and flow the instruction on the wizard , accept default settings and finish settings.
Open the properties of "My Computer" by either right-clicking the icon on the desktop or right-clicking Start > My Computer > Advanced > Environment Variables
Double-click on the "Path" variable on either of the option boxes.
Careful not to delete anything in this box. At the end of the text box, add a semi-colon if there is not one already, and add the path to your java installation
Click "Apply" and "OK" to all the windows you have just opened
Open the command prompt and type "javac" hit enter