The command to use is javac:
javac argument
But the argument to use depends on the current working directory. It must specify the java file.
The working directory can be any directory as long as you specify the location of the java file.