Final answer:
Before compiling a Java program with the command 'javac MyClass.java', ensure the Java Development Kit (JDK) is installed on your system, navigate to the directory that contains 'MyClass.java', and have the file already written and saved with the proper name.
Step-by-step explanation:
Before entering the command javac MyClass.java at the operating system command line to compile a program, several steps must be ensured for the process to be successful. Firstly, you must ensure that you have the Java Development Kit (JDK) installed on your system as it contains the javac compiler needed to compile Java programs. Without the JDK, the javac command would not be recognized. Secondly, you should navigate to the directory containing the Java source file, in this case, "MyClass.java".
This means you use the command line to change the current working directory to the one where your file is located. Lastly, the program code should already have been written and saved as "MyClass.java" using a text editor or an Integrated Development Environment (IDE) before you attempt to compile it.