2

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?

4
  • Have you restarted your cmd once you change the path variable? Nov 8, 2013 at 11:36
  • and how you compile file?
    – Andrew Evt
    Nov 8, 2013 at 11:37
  • In Windows system settings: geekswithblogs.net/renso/archive/2009/10/21/…
    – pasha701
    Nov 8, 2013 at 11:43
  • 2
    Issue solved. Forgot to restart cmd after changing it. Thanks for the help
    – Slyforce
    Nov 8, 2013 at 11:44

4 Answers 4

4

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

0
0

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?

0

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

0

The presence of WinAVR-20100110 is conspicuous; the WinAVR installer seems to be known to clobber the system-wide path. https://www.avrfreaks.net/forum/winavr-deleted-contents-my-path-environment-variable

1
  • Perhaps the literal SET command in the middle of the questioner's PATH is a hint as to how the clobbering is happening...
    – rakslice
    Jan 21, 2020 at 0:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .