On your laptop, create a folder for your work in this course by following these instructions.
Within your s111 folder, create a
subfolder called ps0 for the program
that you are about to create.
Launch VSCodium on your laptop.
In VSCodium, select the File->Open Folder or File->Open menu
option, and use the resulting dialog box to find and open the
ps0 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.
Select File->New Text 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.
Select File->Save, and give the file the following name:
HelloWorld.java
Important: When naming a Java file, the case of the letters matters. Make sure to use the exact combination of upper-case and lower-case letters that we have specified.
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!"); } }
Save the file again by selecting File->Save or using Ctrl-S.
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.
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.
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
let us know by posting a question on Ed Discussion or emailing
cscis111-staff@lists.fas.harvard.edu
Last updated on June 20, 2026.