Hack Workspace in Netbeans IDE
As a long time Eclipse user, I like its workspace concept and the ease of switching workspaces among many other things. The workspace provides a simple yet powerful way to isolate groups of projects into different workspaces under different folders, so you’re not distracted by other un-related projects.
This feature is, however, not available in Netbeans IDE, which is not a big deal most of time. By default, the Netbeans IDE creates a folder under current user’s home directory as follows (yours could be different):
I’ve been using that default location since using Netbeans until recently when I needed to move the default folder to a network drive for backup purpose. After researching on the Web, it turns out it’s not too difficult to change the default location to another directory with a little hack. The default project location is stored in a well-know properties file in a path as follows:
Note that the user name and version number may vary in your environment. Also, the file may not exist before Netbeans runs for the first time. In that case, you can manual create one.
Within the properties file are many key/value pairs with “=” in between as below. Remove all of them, and add the following line:
When the Netbeans starts, it loads the projects under that folder. Note that the folder should be created before Netbeans starts or it defaults back to system default. Once it runs, it may add many more key/value pairs in the properties file.
To hack the switching of workspaces, you can copy the projectui.properties and rename it to something meaningful like projectui_HadoopDev.properties, or projectui_vCenterPlugin.properties. Each one of the properties file corresponds to a workspace you want to keep.
While switching “workspace” to Hadoop development, you just rename projectui_HadoopDev.properties to projectui.properties. Don’t forget to save the existing projectui.properties to a different name. The Netbeans IDE picks up the new workspace after starting up.
This hack works fine but I wouldn’t recommend doing it frequently as the manual copying/renaming can be error prone and when that happens it may mess up the projects. For simple projects grouping, you can consider the existing “Project Group” feature of Netbeans IDE.