Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time I install Netbeans on Ubuntu, I have to edit the ./etc/netbeans.conf file to include an option specifying the look and feel; otherwise, the menus are all black on dark gray, which is impossible to use.

Is there a way to specify a global look and feel for swing apps, so that this isn't such a pain? Here is the line I have to change:

46: netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true"


46: netbeans_default_options="--laf -J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true"
share|improve this question

The menus are dark and gray because of a Java bug. You can find it on Ubuntu's bug tracker. In the meantime, if you want to integrate Netbeans in the global menu, there's a way to do that. Here's how it looks like:

The steps, obtained from this blog post are as follows.

  1. First install openjdk-7-jdk. It's required, so if you use 6, be careful.
  2. To make Netbeans use openjdk-7-jdk, launch Netbeans with

    /opt/netbeans-7.1.2/bin/netbeans --jdkhome /usr/lib/jvm/java-7-openjdk-i386

    You can make a .desktop file in ~/.local/share/applications with that as the exec command, for conveience. Copy the default one and edit it.

  3. Install and use the Java Swing Ayatana plugin from this googlecode page.
  4. Restart Netbeans.
share|improve this answer
Also, the jdk you use in the Exec might be different for you, because I use the 32 bit version. – MarkovCh1 Jul 11 '12 at 21:42
Sweet-- it not easier, but probably worth the effort. It's always annoyed me how java apps don't work with the global menu. – Bryan Agee Jul 11 '12 at 22:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.