Java Error : 'javac' is not recognized as an internal or external command

So you are trying to compile your Java source file and getting "'javac' is not recognized as an internal or external command". If this is your first Java program or HelloWorld than I suggest to go through How to compile and run HelloWorld in Java because that explains what do you need before you compile and run any Java program. If you have crossed that level and knows about How to set PATH in Java then there is something wrong while setting PATH in Java. Anyway let's see when do you get this error and from where does 'javac' is not recognized as an internal or external command comes. This is a standard error in Windows command line when you type a command which is not available in System PATH, here javac command which is used to compile Java source file and produces class files are not in PATH. Best way to verify this is executing the following command :

# echo %PATH%

If you see your JDK installation folder or JAVA_HOME in PATH and included bin directory which contains all java binaries including javac and java commands which are used to compile and run Java program. Most likely your PATH may not have JDK/bin in PATH, if that's the case just include bin folder of JDK in your PATH. See how to set PATH for Java in Windows for step by step guide.
Read more »