Step 1: Download the java from the link
https://www.oracle.com/java/technologies/downloads/
Downloaded x64 for windows.
Step 2: Install java by double clicking the file downloaded.
Step 3:Setup java path
Open the folder where java is installed and copy the url till bin folder.
Go through the image for reference.
C:\Program Files\Java\jdk-19\bin
Now right click on Computer --> properties --> Advanced system settings --> Environment Variables --> new -->
Enter variable name as "JAVA_HOME" and in variable value, paste the java url which you copied. and then click ok.
Now open the command prompt and run javac command.If you get below response,then it means that you have set java path correctly.