Step 6: Run the Program

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

Answer:

Click in the command prompt window to bring it forward and to make it the active window. Then enter the command DIR to list the files.

Step 6: Run the Program

If there are too many files in the subdirectory, enter the command DIR *.java to see just those files that end in .java

If you see the file HelloPlanents.java.txt then you need to put quote marks around the filename in Notepad. To complete Step 6, compile and run the program:

  • RUN: Run the program:
    1. Click in the command prompt window . Do a DIR to check that HelloPlanets.java is there.
    2. Compile the program: C:/Temp> javac HelloPlanets.java
    3. Run the program: C:/Temp> java HelloPlanets

The following shows this being done:

Well, that is the method. It uses skills that users of Windows application programs are familiar with. They will have found this process fairly easy. If you did not, it is merely a matter of practice.

QUESTION 12:

What should you do if you did not find this process all that easy?