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


#1

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


#2

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.


#3

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’?


#4

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

Thanks for your help


#5

No problem. :slight_smile: