GitHub user ChangkeunJ added a comment to the discussion: How to run NetBeans 
31 through terminal as a specific instance by project?

Yes, `--userdir` is the flag you're after. It's the closest thing NetBeans has 
to Eclipse's `-data`:

```
netbeans --userdir ~/.netbeans-instances/spring-framework
netbeans --userdir ~/.netbeans-instances/spring-boot
```

Each userdir carries its own settings, its own list of open projects and its 
own window layout, so you end up with two genuinely separate IDE windows you 
can put on different monitors and configure independently of each other.

The reason your current commands collapse into one window is that NetBeans 
keeps a lock file inside the userdir and uses it to notice an instance that's 
already running. Both of your invocations resolve to the same default userdir, 
so the second one finds that lock, hands the project path over to the process 
that's already up, and exits. Point them at different userdirs and there's no 
lock to find, so you get a second process.

You don't need to pass `--cachedir` alongside it, which is the bit people 
usually go hunting for. netbeans.conf spells it out: if you give a non-default 
`--userdir` and no `--cachedir`, the cache goes to `<userdir>/var/cache` on its 
own, so the two instances aren't quietly sharing one.

One adjustment to the mental model that might help. The userdir is the 
instance, not the project. Passing a project path on the command line only 
opens that project inside whichever instance the userdir resolves to. So the 
userdir is what decides which window you land in, and opening the project is a 
separate thing you do once and let it remember.

GitHub link: 
https://github.com/apache/netbeans/discussions/9574#discussioncomment-18158817

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to