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!