# Why wont java execute from c:\Windows\System32?

Until a few days ago, I was able to run java applications from the command line, then something broke. I traced the problem down to being unable to invoke java.exe from c:\Windows\System32. Even if I give the full pathname (c:\windows\system32\java.exe) it still wont execute "'c:\Windows\System32\java.exe' is not recognized as an internal or external command, operable program or batch file.". I tried coping it to a different name in the same directory but it still wouldn't work. Only when I copied to java.exe to a different directory & putting that dir into PATH did I finally get it to work so this is my workaround solution but I would still like to know why it stopped executing from c:\Windows\System32 after months of being happy there!

-
 I'm not sure how java.exe got into Windows\System32 in the first place but this wasn't an install question. I want to know why java.exe is executable from any directory except this one. – Its me Feb 1 at 21:02 @Karan The Windows installer for Oracle/Sun java does place a copy of the executable in C:\Windows\System32, at least on my Windows 7 machine. This is in addition to the full install located in C:\Program Files\Java – Darth Android Feb 1 at 21:48 @DarthAndroid: You're right, seems it does place a dummy java.exe in system32. – Karan Feb 1 at 22:59

If you want to execute java form the command line, you should add it to your path. Go to Control Panel -> System -> Advanced System Settings, then go to the Advanced tab and click on Environment Variables. Look for the system variable called PATH, and append ;C:\Path\to\java\bin to it. Now you should be able to run java from cmd.exe.