Javac is not recognized - Quick Fix



Java is not recognized as an internal or external command ?. Here are the step by step procedure on how to reproduce the issue Java is not recognized as an internal or external command or 'javac' is not recognized as an internal or external command, operable program or batch file or 'java' is not recognized as an internal or external command, operable program or batch file. and fix the same.



Step By Step Procedure to Reproduce java is not recognized error



There could be many possibilities behind Java in not recognized error, here are the steps you can try to reproduce.

  1. On windows, Click on Start, then type cmd, and hit Enter. You will now get a command prompt screen. Type "java" or "java -version and enter", you will get Java is not recognized as an internal or external command, operable program or batch file error. This happens if the Installed java in not set properly.
  2. C:\Users\Techoral> java
    'java' is not recognized as an internal or external command, operable program or batch file.

  3. Your can also try to Run javac command to compile a java program from command line, you will get Javac is not recognized as an internal or external command ERROR if the installed java is not being set properly.
  4. C:\Users\Techoral> javac 'javac' is not recognized as an internal or external command, operable program or batch file.






# Resolving Java is not recognized as an internal or external command issue



Here are the steps to reslove the error:

  1. Check the Java path environment variable and makes sure that Java path is properly set.
  2. If Java Path is not set, copy the path to Java bin directory go to System Properties --> System Variables and add the java bin folder path.
  3. If you are still facing the issue, you can try reinstalling the java
  4. Before installing make sure to uninstall previously installed Java. Refer Uninstall Java on Windows or if you are using linux / ubuntu please refer Uninstall Java on linux / ubuntu
  5. Once java is completly uninstalled, download and install Oracle / OpenJDK / zulu :



More details about this Bug in OpenJDK -



If the above steps didn't resolve this issue, please refer OpenJDK Bug for details.

 Description   
ADDITIONAL SYSTEM INFORMATION :
Windows 7 Professional Service Pack 1 64 bit JDK 11

A DESCRIPTION OF THE PROBLEM :
I have installed jdk 11 on windows 7 machine and have given JAVA_HOME in system variables. After that also java not recognized in my command prompt.

REGRESSION : Last worked in version 8u172

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
I have installed jdk 11 on windows 7 machine and have given JAVA_HOME in system variables. After that also java not recognized in my command prompt.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
on entering java -version it should return java version.
ACTUAL -
'java' is not recognized as an internal or external command

FREQUENCY : always




 Comments   
Comment by Priyanka Mangal (Inactive) [ 2018-09-12 ]
Submitter replied:
"yeah after adding bin to path it is working. In earlier version i never used to provide."

Closing this as Not an issue.


please refer bug at Java is not recognized as an internal or external command More about this bug @ OpenJDK Java error code 1603



Read Next :