
For those working with NetBeans on a Windows ( for sure XP and Vista ) machine this error is well known.
Do not worry, fix is very simple, just add an extra option in the configuration file.
You can find netbeans.conf under
C:\Program Files\NetBeans\etc
This is the original conf row
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
Simply add this extra parameter to the above row
-J-XX:MaxPermSize=128m
Finally the row looks like
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
Restart NetBeans and enjoy coding.