How To: Create a NetBeans Startup Project

As a user of the NetBeans IDE, I have always had this one complaint. NetBeans has what they call Project Groups. These are used to group projects that should be worked on at the same time, similar to a Solution in Visual Studio. You can define multiple Project Groups and switch between them. Great, right? What’s the problem?

The problem lies in the fact that NetBeans will always open the last Project Group that you had open when it starts up. Some of the projects that I work on are quite large, with Maven repositories that must be scanned and re-indexed upon startup. That’s all fine and good if that is the project I am working on, but if it isn’t then it becomes a big headache. Then I must cancel the operations and try to convince my machine that I really don’t want to go through all of that scanning and indexing… I just want to open up a much smaller project or even create a new one.

My solution: Create a Startup Project Group and have NetBeans always open that when starting. Here’s how to do it.

Create a Startup Group

  1. Open the NetBeans IDE
  2. From the File menu, select Project Groups…
  3. Click the New Group… button
  4. Enter something appropriate for the Project Group Name (i.e. Startup Group)
  5. Select Free Group and uncheck all of the boxes, then click the Create Group button
  6. You’ll be left with NetBeans having opened/selected your new Project Group, which should be empty. Now just close NetBeans.

Configure NetBeans Startup

The next step is going to assume that you are on a Microsoft Windows platform.

  1. Right-click the NetBeans program icon on your Desktop and select Properties in the popup context menu.
  2. Click on the Shortcut tab.
  3. Now just append the text --open-group Startup  to the Target text box.
    (NOTE: Substitute “Startup” for whatever you named your Project Group in the previous steps. If you used spaces in your name, you’ll probably want to wrap the name in double quotes.)
  4. Now just click the OK button to save.

Enjoy the Faster Startup

Having made these changes, whenever you launch NetBeans (via your Desktop shortcut) the IDE will open up your Startup Project Group. Being that this group is empty, the startup times will be much quicker.

What If I’m Not Using Windows?

If you are using Linux or Mac, you just need to alter the way you launch NetBeans. In all of those environments, the NetBeans executable should accept the command line argument to specify the “open group”. If you are reading this post, then I’ll assume you are a developer and can manage to figure out how to do that.