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 fixed my slow Netbeans 7.1 as well. I’m on Ubuntu 11.04.
Sure, glad it helped!
When running update I get the following:
W: Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/oneiric/main/source/Sources 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/oneiric/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http://ppa.launchpad.net/sun-java-community-team/sun-java6/ubuntu/dists/oneiric/main/binary-i386/Packages 404 Not Found
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.
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/.
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.
The solution helps with Netbeans 7.2 too