sudo apt-get install netbeans
It opened correctly but I noticed it didn’t have all the plugins I required. First, i tried to install them from “Help | About | Plugins”. It complained about not having permission to extract/install the plugin. So, I closed netbeans and started it with root user, then it finished adding the plugins but when I tried to start it again with my regular user it wouldn’t boot.
I decided to remove netbeans repositorie’s version and instead download and install manually.
sudo apt-get purge netbeans
I’ve downloaded and extracted the OS independent full version of netbeans on my home directory ‘~/Apps/netbeans/8.1’ but when I tried to start it from the terminal nothing happened.
As it happens, the problem was that when I started netbeans as root it changed ownership of some files on two folders: ~/.netbeans and ~/.cache/netbeans
The solution is to delete those folders (those will be recreated when starting netbeans) and start netbeans again as a regular user.
sudo rm -rf ~/.netbeans ~/.cache/netbeans