http://happy-coding.com/install-sun-java6-jdk-on-ubuntu-10-04-lucid/
first you need install jdk follow the above article
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
then
sudo chmod +x ./netbeans xxxx .sh
./netbeans .....sh