javac is not recognized as an internal or external command, operable program or batch file [closed]
The error javac is not recognized as an internal or external command, operable program or batch file
occurs when you try to run the javac
command from the command prompt, but the command prompt cannot find the javac
executable.
There are a few possible causes for this error:
javac
is not in your system's PATH: Thejavac
executable is not in a directory that is listed in your system's PATH environment variable. To fix this, you need to add the directory wherejavac
is located to your PATH.You have multiple versions of Java installed: You might have multiple versions of Java installed on your system, and the command prompt is using a different version of Java than the one that contains the
javac
executable. To fix this, you need to update your PATH to point to the correct version of Java.You have a typo in the command: Make sure that you have typed the
javac
command correctly.
To add javac
to your PATH, you need to do the following:
- Open the Start menu and search for "Environment Variables".
- Click on "Edit the system environment variables" button.
- Click on the "Environment Variables" button.
- In the "System Variables" section, scroll down and find the "Path" variable, and click on "Edit".
- Click on the "New" button and add the directory where
javac
is located. - Click on "OK" to save the changes.
After adding javac
to your PATH, you should be able to run the javac
command from the command prompt.
I hope this helps! Let me know if you have any other