Windows – Why wont java execute from c:\Windows\System32

javawindows 7

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!

Best Answer

Your problem may have to do with 64-bit vs 32-bit Java JRE installation. I was having similar problems where I could see

C:\Windows\System32\java.exe

but was unable to run it. I found a thread which hinted that there should be a copy of the file at

C:\Windows\SysWOW64\java.exe

for the 64-bit Java to execute from a 32-bit app.

In my case I know a corporate security patch confounded my installation since it worked then didn't work right after I allowed the patch to run.

Related Question