Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com 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? –  Pradeep Simha Nov 8 '13 at 11:36
    
and how you compile file? –  Andrew Evt Nov 8 '13 at 11:37
    
In Windows system settings: geekswithblogs.net/renso/archive/2009/10/21/… –  pasha701 Nov 8 '13 at 11:43
2  
Issue solved. Forgot to restart cmd after changing it. Thanks for the help –  Slyforce Nov 8 '13 at 11:44

3 Answers 3

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 http://docs.oracle.com/javase/tutorial/essential/environment/paths.html

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

Thanks

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.