This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The NetBeans IDE uses dedicated ports to listen to external actions (scripting server, HTTP server and OpenFile server). This prevents seemless cooexistence of multiple instances on the same computer. Should be at least documented if not fixed.
Fixed how?
When an IDE is started, it writes a file into the userdirectory, containing a secret key as well as a port number that the instance will listen to. Then whenever one wants to connect to the IDE or start it again, the newly running process can read the port number and secret key and telnet to the port some command - for example "open file" or "give me the port number telnet is listening to" or "give me your http server port". The lockfile and internal port + security would be implemented by the infrastructure and there would be a "CLI API" that modules could enhance and react to various command line options. So utilities module would add "--open file" option and httpserver "--http status" option, etc. This could in my opinion cleanup the runide.*
We should probably remove the openfile functionality anyway, since it does not seem to be very frequently used, is unreliable and causes a problems with multiple IDE instances.
I have written a proposal http://openide.netbeans.org/proposals/arch/cli.html and prototype which solves problem with multiple instances and with unreliability very likely as well.
Reassigning to utilities module (the home of openfile)
Not a docs issue, should be fixed.
BTW one thing that should be fixed up when converting openfile along these lines: the openfile API (and utilities.jar cmdline interface) supports a -line option to specify a line number in the file. (This is pretty much necessary for a *.xml file: if you don't specify it, the file is opened for some reason in a web browser!) However the runide.sh interface does not support this option. Would be easier to fix (given the existence of both the cmdline interface and the ${netbeans.openfile} sysprop) using issue #32054's infrastructure.
I am working on it, to test issue #32054.
Have working patch based on #32054. (Patching utilities/projects too.) Works nicely. Just use -open FILE or -open FILE:LINE on the NB command line and the file will be opened. If NB is not already running, it is started, and when the GUI comes up, then the request is processed. Entirely implemented in utilities module, no special support in core other than the general CLIHandler hook. Removing Open File Server, both in code and UI - it is no longer necessary.
Do you plan to apply the change? I remember that when I worked on the core part the CLIHandler seemed to me like a bad API, too general and not suitable for cooperation between modules. Also I did not know where to put it. The API should probably be in org.openide.modules, but that JAR file cannot be referenced from boot.jar (where the core impl is). So I stoped work on it and wanted to finish openide.jar separation first and place openide-util.jar and openide-modules.jar on the classpath as boot.jar is.
Re. poor API - some improvements made since then, see issue #32054 for details. Anyway, consider this a "friend" API for now, to improve on the poor existing situation. A cleaner API for the future (e.g. using getopt) is still a possibility. committed 1.50 core/release/bin/runide.sh committed 1.357 nbbuild/build.xml committed 1.42 utilities/build.xml committed 1.51 utilities/manifest.mf added 1.1 utilities/clisrc/META-INF/services/org.netbeans.CLIHandler added 1.1 utilities/clisrc/org/netbeans/modules/openfile/cli/Callback.java added 1.1 utilities/clisrc/org/netbeans/modules/openfile/cli/Handler.java committed 1.4 utilities/projects/build.xml committed 1.3 utilities/projects/manifest.mf committed 1.3 utilities/projects/src/org/netbeans/modules/openfile/projects/OpenFileImpl.java added 1.1 utilities/src/META-INF/services/org.netbeans.modules.openfile.cli.Callback committed 1.33 utilities/src/org/netbeans/modules/openfile/Bundle.properties added 1.1 utilities/src/org/netbeans/modules/openfile/CallbackImpl.java committed 1.2 utilities/src/org/netbeans/modules/openfile/DefaultOpenFileImpl.java removed 1.16 utilities/src/org/netbeans/modules/openfile/Main.java committed 1.58 utilities/src/org/netbeans/modules/openfile/OpenFile.java committed 1.30 utilities/src/org/netbeans/modules/openfile/OpenFileAction.java committed 1.4 utilities/src/org/netbeans/modules/openfile/OpenFileImpl.java removed 1.1 utilities/src/org/netbeans/modules/openfile/Openfile.settings committed 1.6 utilities/src/org/netbeans/modules/openfile/PackagePanel.java removed 1.25 utilities/src/org/netbeans/modules/openfile/Server.java committed 1.32 utilities/src/org/netbeans/modules/openfile/Settings.java removed 1.22 utilities/src/org/netbeans/modules/openfile/SettingsBeanInfo.java committed 1.27 utilities/src/org/netbeans/modules/utilities/Installer.java committed 1.51 utilities/src/org/netbeans/modules/utilities/Layer.xml committed 1.6 utilities/www/plans/plan.xml
removing RELNOTE keyword