The ‘javac’ is not recognized as an internal or external command, operable program or batch file is a very common error when you first install Java JDK on Windows machines. Here is how you can fix it.
Find javac location
Find the location of your Java JDK install where javac resides. Typically it will be something similar to: C:\Program Files\Java\jdk-XX.X.X\bin. Copy the location path of the folder.
If you do not find the folder, search “javac” in your C drive and open the file location.
Solution 1: Update the system variable PATH from GUI
1) Type Environment on the Windows search and open Edit the system environment variables. This will open System Properties window.
2) Under Advanced tab, select Environment Variables…. This will open the Environment Variables window.
3) Highlight Path and select Edit… to open Edit environment variable window.
4) With Path selected, click Edit.. and the javac path you found in your computer.
Solution 2: Update the system variable PATH from CMD
Open Windows Command Prompt (CMD) and enter the following an press Enter,
set PATH = %PATH%;”C:\Program Files\Java\jdk-XX.X.X\bin.
Please note you must replace C:\Program Files\Java\jdk-XX.X.X\bin with the path you found in your computer.