Go in the directory where your jdk is installed.
Place your .java file in bin folder located inside jdk folder.
Go to command prompt and move to jdk\bin directory
And then write javac...