The code compiles and runs fine. It looks like you don't have the correct file name in use, or that you're not running the javac properly if manually doing it from the command line.
Did you use an IDE for this, or did you just create a text file? Check the directory for this, and see what the extension is (it has to be .java).
header('HTTP/1.1 420 Enhance Your Calm');