Last modified: January 07, 2023
Let's write your first Java program that prints out "Hello, world!"!
In the top left corner, click on Project | New Project.
The pop-up window asks for you to give a name for your new project and a folder location to save the java files. For now, just use "HelloWorld" as project name and use the default folder location.
Click OK on the pop-up windows. Now, you should have a new project named "HelloWorld" created.
Click on "New Class" on the left side. Don't worry about what "class" means yet. When prompted to enter the "class name", just enter "HelloWorld" and click OK.
The above action should create a yellow box titled "HelloWorld". Click on it, which will open a separate window for you to edit the code in that file.
Delete everything in the file and put the following into it:
public class HelloWorld {
public static void main(String[] args){
System.out.println("Hello, world!");
}
}
To get your first program running:
Click on void main(String[] args)
Then click OK on the pop-up windows without modifying any default values.
If you see the following, congratulations on creating and running your first Java program!