NetBeans is Slow on Ubuntu 10.10 – Switch Your JDK

NetBeans can be slow, very slow.  After trying out everything on the NetBeans Performance FAQ to no avail, I finally reached the point where I decided to switch to another IDE instead of trying to manage NetBeans’ performance problems.  Before doing so, I got a tip from a friend to check my JDK and switch to the Sun JDK if I wasn’t using it already.  Turns out I wasn’t, I was using the OpenJDK all along, so I decided to give the Sun JDK a shot. It actually turned out to be the silver bullet I needed.  After installing it, NetBeans returned to being snappy and responsive again … here’s how to make the change on Ubuntu 10.10.

First, you may need to add the sun-java6 repository before hand, but that’s not that big of a deal. You can run the following 3 commands to add that repository and install the Sun Java 6 JDK:

sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk

Once that’s done, you’ll need to update your Java alternatives so that everything that requires the JDK will use the Sun Java 6 JDK vs. whatever other JDK you have installed. To do so, run the following command and choose the Sun JDK:
[code lang=”bash”]sudo update-alternatives –config java[/code]

Once your JDK is updated, you’ll still need to update the JDK that NetBeans uses. To do so, open the netbeans.conf file and update the netbeans_jdkhome directive to point to the new JDK:

Once that’s done restart NetBeans and you’ll be welcomed with a snappy, responsive IDE!

This entry was posted in General, Performance. Bookmark the permalink.

7 Responses to NetBeans is Slow on Ubuntu 10.10 – Switch Your JDK

  1. Jorge says:

    This fixed my slow Netbeans 7.1 as well. I’m on Ubuntu 11.04.

    Thanks!

    • mzarate says:

      Hey Antony,

      I suspect you didn’t run the first command to add the Sun repo:

      sudo add-apt-repository ppa:sun-java-community-team/sun-java6

      Did you? If not, run that first, then update.

  2. Marc says:

    On Ubuntu installation of sun-java is not possible any more since january. You have to do it like described here: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/

    In addition these tips did a good performance boost in addition for me: http://chemicaloliver.net/programming/customising-netbeans-for-better-performance-and-ease-of-use-as-a-php-ide/.

    Regards,

    Marc

  3. Marc says:

    one addition: When I write “On Ubuntu installation of sun-java is not possible any more since january.” I’am talking about installation via apt.

  4. Marc says:

    The solution helps with Netbeans 7.2 too

Leave a Reply to Jorge Cancel reply

Your email address will not be published. Required fields are marked *