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

I get this error when I try to run a script. I know the location of the JDK in the Java bin folder, but what do I do so that I don’t get this error?

I have this path C:\Program Files\Java\jdk1.8.0_101\bin
Can I use this path to direct Atom to so I don’t get this error?

Thanks in advance

When you’re asking a question about a package, it’s important to be specific about the name of the package. There may be multiple packages that compile Java and they might work differently.

Fortunately, your issue is not a package problem. You need to go to Control Panel -> System -> Advanced System Settings -> Environment Variables. In the bottom panel, locate and select Path, click on Edit, and then Add a new entry, with the text C:\Program Files\Java\jdk1.8.0_101\bin. Close the Atom application completely and reopen it and you should be able to compile things just fine. You can verify that the command works by typing javac into the command prompt. If it works, it will give you a bunch of lines of help for how to use the command.


Hi, I’m pretty new to coding and just started learning Java. I downloaded Atom as a recommended text editor.

I have managed to find the window Enviroment Variables and I have the path for this JDK C:\Program Files\Java\jdk1.8.0_101\bin but what do I put as the ‘Variable name’?

I’ve done it now. I had to edit ‘PATH’ not create a new one.

Thanks for your help

No problem. :slight_smile:

I had the same problem and this worked, but only in the command line. It still says the same thing in Atom.

1 Like

Have you restarted Atom? If so, open a terminal inside Atom (using a package like termination or atom-ide-ui) and run the command echo %PATH%. Then run that again outside of Atom and you should see what the difference is.

So this is what happens when I do that and then try to run the program. I am able to run python programs just fine but for some reason java ones do this. it also did the cmd thing when i tried to run a C++ program.

Sorry, I forgot that PowerShell has weird syntax. Open termination and run cmd to get to the normal shell. Like this:

Then open a cmd window from outside of Atom and run the same command. Finally, compare the output to see if anything is different.


thank you so much dear, error resolved with your solution.

1 Like

I tried this and now the path is set in command prompt but it still shows the same error in Atom.

I tried to run my java using the “Script” package but it shows that javac is not recognized as internal or external command. I have the path set as also visible in the command prompt to C:\Program Files\Java\jdk1.8.0_101\bin