How to Fix Error: Javac Is Not Recognized on Windows 10
This tutorial demonstrates how to solve the "javac is not recognized on windows 10"
issue.
the javac
Is Not Recognized on Windows 10
The error "javac is not recognized on windows 10"
commonly occurs with beginners or Java programming. The javac
is a command used to compile the java programs; it invokes the javac.exe
application in the bin directory of JDK.
Whenever the error "javac is not recognized"
occurs, the JVM cannot find the file javac.exe
. Either the file has been deleted, or the Environment variable is not set for the JDK.
javac
can be found in the C:\Program Files\Java\jdk-17.0.2\bin
directory.
If JVM cannot find the javac
file, it will throw the "javac is not recognized on windows 10"
. See example:
'javac' is not recognized as an internal and external command.
This error occurs when the PATH environment variable is not set for Java. To solve this issue, we need to set the PATH variable, which the system will use to find the executable files.
As mentioned above, the javac
is located at the path C:\Program Files\Java\jdk-17.0.2\bin
. The version of JDK can change according to your version.
The following steps below sets the PATH environment variable on windows 10.
-
Search
Environment Variable
in the Start menu. -
Open the
Edit the system environment variable
option, which will open the system properties with the Advanced Menu. -
Click on the
Environment Variable
option to open a new tab. -
Now, in the System Variables, select Path and click edit.
-
Click new and paste the path
C:\Program Files\Java\jdk-17.0.2\bin
. -
Click
Ok
, and the Path variable is set.
Once the Path variable is set, you can run the Javac
command to compile the files successfully.
Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.
LinkedIn FacebookRelated Article - Java Error
- How to Fix the Error: Failed to Create the Java Virtual Machine
- How to Fix the Missing Server JVM Error in Java
- How to Fix the 'No Java Virtual Machine Was Found' Error in Eclipse
- How to Fix Javax.Net.SSL.SSLHandShakeException: Remote Host Closed Connection During Handshake
- How to Fix the Error: Failed to Create the Java Virtual Machine
- How to Fix Java.Lang.VerifyError: Bad Type on Operand Stack