‘javac’ is not recognized as an internal or external command

Now you are getting the error ‘javac’ is not recognized as an internal or external command while running.

This is because the Javac file is not available on the command line or it’s not recognized.

You need to call it.

How?

just 2 processes.

  1. find the javac.exe file location
  2. add this location on Environment Variables.

Done.

first, see the javac file, where is located it.

Go to your computer directory -> C:\Program Files\Java\jdk-16.0.1\bin

note (don’t copy my this location C:\Program Files\Java\jdk-16.0.1\bin)

Then you can see the javac.exe file

Just copy the address C:\Program Files\Java\jdk-16.0.1\bin

and add on Environment Variables

If you don’t know how to add Environment Variables then follow

In window 10 just search Environment Variables or go to the setting then system and click on about then you can see on the right side advance system setting.

then will open the dialogue box.

on this box select the advanced option and click under the Environment Variables button

after then

on the System variables section select the Path then click on the edit button

next just click on the new button on the right side then paste the or add the address or location of the path

Done.

Congratulation, it’s set up.

please close the opened IDE or editor for one time after completing this process and open it again.

If you want to check, working or not then just open cmd and type java -version

If correct then it shows

C:\Users\HP>java -version
java version “16.0.1” 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)

Leave a Reply