Main concepts in this post:
- --userdir NetBeans command line switch
- opening multiple instances of NetBeans IDE
- Netbeans about dialog box
This post answers questions like:
- How to open two NetBeans IDE simulteneously?
- What is NetBeans user directory?
- What is the --userdir NetBeans command line switch?
- How to know the current user directory of NetBeans?
- How to use same NetBeans installation to open two instances?
Many a times we need to look two projects at the same time in NetBeans IDE. If both the projects are open in two seperate NetBeans IDEs that will be easier to look into one IDE instance having one project and code into the other instance of the IDE for the other project.
The NetBeans IDE maintains one user directory for one instance. The trick is to make seperate user directories and make shortcuts of NetBeans IDE to start the instances in those seperate user directories. Through these shortcuts we can pass the instruction to the IDE about what user directory to choose while running the instance.
Let us take an example. We will create two directories
1. D:\nbuserdir1
and
2. D:\nbuserdir2
Now we will create two shortcuts on the desktop which can be done by copying the NetBeans shortcut in the start menu and making two copies with dufferent names. Now we will right click on the shortcuts and will choose the properties. Then we will change the execution path and add the additional part to that command as
<netbeanscommand> --userdir D:\nbuserdir1 for the first shortcut
and
<netbeanscommand> --userdir D:\nbuserdir2 for the second shortcut.
Now we are ready to execute the NetBeans IDE in two instances. When we double click on those instances we will have two seperate IDEs running simulteneously.
To check which user directory is currently used by the running IDE we can open the Help > About diablog box. This dialog box will also show us the user directory used by the running instance.