CS 112
Fall 2026
  • Home
  • Syllabus
  • Staff
  • Office Hours
  • Labs
  • Problem Sets
  • Resources
  • Collaboration
  • Lectures
  • Piazza
  • Gradescope

Creating and Running a Program in VSCodium

  1. On your laptop, create a folder for your work in this course (e.g., one called cs112).

  2. Within your cs112 folder, create a subfolder for the program that you are about to create (e.g., a folder called lab0).

  3. Launch VSCodium on your laptop:

    • On Windows, use the Windows button in the lower-left corner of your Desktop to search for and run VSCodium.

    • On macOS, use the Spotlight tool to search for and and run VSCodium.

  4. In VSCodium, select the File->Open Folder or File->Open menu option, and use the resulting dialog box to find and open the folder that you created in step 2. The name of the folder should appear in a new Explorer pane on the left-hand side of the VSCodium window.

  5. Select File->New File, which will open up an empty window known as an editor window for your new program. It will initially have a name that is something like Untitled-1.

  6. Select File->Save, and give the file the name HelloWorld.java.

  7. Copy and paste the following code into the editor window for HelloWorld.java:

    public class HelloWorld {
        public static void main(String[] args) {
            System.out.println("hello, world!");
        }
    }
    
  8. Save the file again by selecting File->Save or using Ctrl-S.

  9. Open VSCodium’s built-in Terminal pane. You can do this by pressing the Control key and the backtick key, or by selecting Terminal->New Terminal from the menu.

  10. The Terminal should open at the bottom of the VSCodium window. It should already be in the ps0 folder. To compile your program, type the following command in the Terminal and then press Enter:

    javac HelloWorld.java
    

    If the command succeeds, you should not see any output. You should see a new file named HelloWorld.class in the Explorer pane.

  11. To run your program, type the following command in the Terminal and then press Enter:

    java HelloWorld
    

    You should see the following output:

    hello, world!
    

    Important: When using the java command, use the class name HelloWorld, not the file name HelloWorld.java. Java class names are case-sensitive, so the capitalization must match exactly.

If you encounter any problems in getting the program to run, please post your question to Piazza, our class discussion site. The link to our Piazza course page is available on this site’s navigation bar.

Last updated on September 7, 2026.