1

I want .java files to open with NetBeans, but Ubuntu doesn't offer the option, neither in the drop down menu nor properties>open with.

I also should mention that I'm using Ubuntu 14.04.

EDIT: Nevermind. I was eventually unable to do it, or to get netbeans to compile, or th use this version or that, so I gave up. I finaly managed to get gedit configured correctly, so this problem is not moot. Thank you for your help.

2
  • What version and flavor of Ubuntu are you using?
    – kraxor
    Jul 1, 2014 at 1:09
  • @kraxor I'm using 14.04, plain vanilla Ubuntu, as opposed to Xubuntu or something.
    – Cormac
    Jul 1, 2014 at 16:55

1 Answer 1

0

Can I associate a file type with NetBeans to be able to open files of that type from File Explorer?

http://wiki.netbeans.org/FaqCliOpen

Yes, you can. Just pass the name of the file to be opened as the only argument in your command line interface.

For example:
netbeans MyFile.java


The same command can be used to create an association for files of specific types in the file manager (below)

You can also use the explicit --open option for clarity, and pass more than one file; for example, on Unix:
find src -name \*.java -print0 | xargs -0 netbeans --open

If there is an instance of the IDE already running, the file will simply open in this instance and the command will exit. You may need to pass the --userdir option to match the user directory of the running IDE.

In addition, you can specify the line at which the file should open (line numbers start at 1):
netbeans Something.java:55

8
  • Ubuntu doesn't let me input a path. It offers me options, none of them Netbeans.
    – Cormac
    Jul 1, 2014 at 17:04
  • @Mack - answer edited
    – Ben
    Jul 1, 2014 at 18:30
  • @boon - I tried this and it still opens with gedit and doesn't give me the option for netbeans. should I put in the path to netbeans?
    – Cormac
    Jul 1, 2014 at 20:17
  • Wait, I may have found the problem. I used the Netbeans installer, and the system doesn't think it has netbeans installed. I'm installing netbeans now with apt-get. I'll report back with the results.
    – Cormac
    Jul 1, 2014 at 20:58
  • Nope. Didn't work. Still no option.
    – Cormac
    Jul 1, 2014 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .