netbeans Getting started with netbeans Run Your Java Program with Netbeans IDE

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

So, you have completed installation it's time now to Run you program with it. Netbeans has created a shortcut to your desktop, "Double click" that to open the IDE.

To Create a new project

1. Click this this button button OR

  • Goto: files >> New Project then this window will popup

enter image description here

Select Java from categories (from the left side) And Java Application from projects (form the right side) as indicated in the image above.

2. Click Next > button then this window will popup

enter image description here

Provide an appropriate "Project Name" You can name it anything you want But it's Good to name it relevent to your work.
You can change the location of your project folder by clicking on Browse... button.
If you want Netbeans to create a class for you automatically then keep the "Create Main Class" checkbox checked.

3. Click Finish button.

After that IDE will open code editor window for you. Necessarily it will create 3 things:

  1. package name
  2. class name
  3. main method

It should be like this

package your_package_name;

public class your_class_name {
   
    public static void main(String[] args) {
        // TODO code application logic here
    }
    
}

It may have some comments don't consider that right now.

4. Now replace

     // TODO code application logic here

with this one

  System.out.println("Welcome New Programmer");

5. Now "right click" in the code editor and select Run File OR press shift+f6 it will print

"Welcome New Programmer"


Got any netbeans Question?