I was having the same problem posted in this title. Java would work, but javac
would not in the Windows command prompt (cmd.exe
).
For me, it was simply that I had placed a space when adding C:\Program Files\Java\jdk1.8.0\bin
to the end of my %PATH%
environment variable.
Remove the space between the ;
and the next file path.