I know that apt-get is good for downloading netbeans IDE. but if it is not working (i was behind a proxy, working on a PHP app, and netbeans IDE installed via apt-get is refusing to get plugins for PHP), then you can download the .sh files from netbeans official site and install it.
You need to make the .sh file executable. 🙂
The lasted version is build on java 7 and it may show a problem while you are installing with a older java, showed me also. But i am using the IDE now and found no error yet.