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
- Open the NetBeans IDE
- From the File menu, select Project Groups…
- Click the New Group… button
- Enter something appropriate for the Project Group Name (i.e. Startup Group)
- Select Free Group and uncheck all of the boxes, then click the Create Group button
- 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.
- Right-click the NetBeans program icon on your Desktop and select Properties in the popup context menu.
- Click on the Shortcut tab.
- 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.)
- 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.