You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Thomas Wolf <tj...@gmail.com> on 2021/04/30 02:32:48 UTC

opening a file with netbeans via command-line in macOS?

I’m running 12.3 on Java 14 and I want to open a file in NB from the
commandline and have it highlight a given line.  If NB is not currently
running, this works:

open -a /Applications/NetBeans/Apache\ NetBeans\ 12.3.app --args
/Users/twolf/spectare/sat_projects/zlib-1.2.11/compress.c:15

But if NB is already open, nothing happens -i.e. the file doesn’t appear in
the editor.

I vaguely remember this (or something like this) working in Linux.  Can
someone point me to any reference that shows what the correct methods are
for macOS, Windows, and Linux?

Thanks in advance,
Tom

Re: opening a file with netbeans via command-line in macOS?

Posted by Malcolm Fitzgerald <ma...@notyourhomework.net>.
It would be great to be able to double-click a file in the finder and 
have it open in NetBeans too.


Malcolm

On 30/04/21 2:32 pm, Thomas Wolf wrote:
> I’m running 12.3 on Java 14 and I want to open a file in NB from the 
> commandline and have it highlight a given line.  If NB is not 
> currently running, this works:
>
> open -a /Applications/NetBeans/Apache\ NetBeans\ 12.3.app --args 
> /Users/twolf/spectare/sat_projects/zlib-1.2.11/compress.c:15
>
> But if NB is already open, nothing happens -i.e. the file doesn’t 
> appear in the editor.
>
> I vaguely remember this (or something like this) working in Linux.  
> Can someone point me to any reference that shows what the correct 
> methods are for macOS, Windows, and Linux?
>
> Thanks in advance,
> Tom
>