As agreed above - make sure you uninstall any previous installation of java - visit the below link :
Sun Microsystems
And install the specific java system for your system - always good to have auto update checkboxed , therefore you are garunteed the latest , most stable java platform for your OS . Sun Systems provide regular updates via autoupdate . Sun Netbeans is always my preferrred choice and on all OS's I've used , never has any problem arisen .