Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried to compile a java file and I got the "javac isn't recognized as an internal or external command" error. Last week it worked just fine.

The PATH variable seems to have been modified by something. I've tried changing it back to the correct address (C:\Program Files (x86)\Java\jdk1.7.0\bin), but it doesn't seem to reset. When I go into cmd and type Echo %PATH%, I get the following message.

C:\WinAVR-20100110\bin;C:\WinAVR-20100110\utils\bin;set PATH="C:\WinAVR-20100110 \bin;C:\WinAVR-20100110\utils\bin;C:\Program Files (x86)\Java\jre7\bin"

How should I change the PATH variable?

share|improve this question

migrated from Nov 9 '13 at 10:50

This question came from our site for professional and enthusiast programmers.

Have you restarted your cmd once you change the path variable? – Simze Nov 8 '13 at 11:36
and how you compile file? – Andrew Evt Nov 8 '13 at 11:37
In Windows system settings:… – pasha701 Nov 8 '13 at 11:43
Issue solved. Forgot to restart cmd after changing it. Thanks for the help – Slyforce Nov 8 '13 at 11:44

set PATH="C:\WinAVR-20100110 \bin;

this looks suspicious.

The system goes through all your paths in the PATH till it finds javac. If not, it will tell you that javac is not recognized.
As a test, I suggest you move the path to Java bin to the start of PATH variable and see if that helps.

You change the path variable through Advanced System Settings. You can find the steps here

share|improve this answer

The path-entry C:\Program Files (x86)\Java\jre7\bin looks like there's a jre7 installed on your computer. Could it be that someone accidentially replaced the jdk with a jre when installing the latest version? Is the jdk still there?

share|improve this answer

The error happens because the command prompt cant find the java compiler.To solve this just add the path of the compiler to system path.You can add that by going to MyComputer->Properties->Advanced system settings->Environment variables and add the path to PATH variable The javac can be found at C:\Program Files\Java\jdk\bin


share|improve this answer

You must log in to answer this question.