Javac is not Recognized as Internal Command or External Command

By | March 7, 2022

Compiling Java applications involves the use of Javac. Java is not recognized as an internal or external command when compiling a java program from the command line. You need to know, how to fix this issue.

Javac is not Recognized as Internal or External Command

Step-1: First of all, we must have JDK installed on our computers in order to compile Java programs. The appwiz.cpl tool can be used to find out whether it is installed on your computer. Java applications cannot be developed simply by having JRE installed. You will also need a Java development kit if you wish to develop Java applications. Java Runtime Environment (JRE) runs only existing software, while Java Development Kit runs pre-built software.

Step-2: The PATH environment variable should point to the directory where java executables are stored if java is installed.

  • Go to the open the command prompt.
  • Then, run “set path”. Using this command, you can find out what the value of the path environment variable is right now. All the directories are displayed in the list. Verify that the Java SDK path has been added. This should look something like below if it is added.
c:\>set path
Path=C:\Program Files (x86)\Windows Resource Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Quarantine\;C:\Program Files\Perforce;C:\Program Files\Microsoft Network Monitor 3\;c:\Program Files\Java\jdk1.7.0_17\bin
  • The JDK path can be added now if it isn’t included. In addition to the SDK version you installed, the location of the installation would also affect the path you need to add. You need to check the folder [C:\Program Files\java] & [c:\Program Files (x86)\java] to find the exact route.
  • Check once more for the path to the bin folder if PATH is set to the java location. Then, adding c:\Program Files\Java\jdk1.7.0_17 which is not correct. Next, you need to add c:\Program Files\Java\jdk1.7.0_17\bin.
  • Either the command prompt or the GUI can be used to change the PATH variable.
  • Below are the steps for modifying PATH using GUI.

How to Set the JDK (Java Development Kit) path?

Step-1: Open the system properties [Run sysdm.cpl]
Step-2: Go to click on the Advanced Tab.
Step-3: Now, click on the “Environment Variables” button.
Javac is not Recognized as Internal Command or External Command
Step-4: The PATH variable is located under “System Variables”. Change the path to include JDK.
Javac is not Recognized as Internal Command
Step-5: Click on “OK” & close the Window tab.

You are now able to see that the JDK path is added to the command prompt when you run ‘set path’. You will not be able to print the updated path, Using a window that was open before you modified your PATH variable will enable you to run the command. Likewise, setting a PATH has to be done in a separate command window for java programs to compile.

You may also like: Driver Power State Failure Windows 10/8/7 – Blue Screen Fix

Leave a Reply

Your email address will not be published. Required fields are marked *