Open the Command Prompt from the Start Menu. You can also press Win + R, then type cmd.exe into the Run field. 3. Use the cd command to change your working directory to the directory containing your Java program. Mine is saved in my “Scripts” folder, but you can save your file anywhere you’d like on your system.How do you open a command line?
Using the Run Program Open the Run program. Hold the ⊞ Win key and press the R key to open the Run window. Type cmd into Run. This is the command to open Command Prompt. Click OK. Doing so runs the "cmd.exe" command, which opens Command Prompt.