"The java tool launches a Java application. It does this by starting a Java runtime environment, loading a specified class, and invoking that class's main method"
So the input of javac is the java file and the input of java is class which contains the main method.
Thank you .
subject: Why javac requires .java extension and java command does not?