- log in as a normal user.
- download the netbeans installer from https://netbeans.org/
- su to root in a terminal.
- run the netbeans installer from the command line at the root prompt.
- click the customize button to install glassfish and tomcat.
- change the install path for each package to /opt/<name of package>
Once done, we needed to perform some post-install tweaks.
- We needed to fix permissions to the installed files and directories.
- The netbeans menuitem did not appear and so that needed to be added.
- And the third tweak was a workaround with the mouse focus not matching the mouse pointer and disappearing menus as described in this bug.
We run the Mate desktop environment and so this script sets the DESKTOP_SESSION variable to mate for the netbeans process. If you use gnome3 then DESKTOP_SESSION=gnome-shell is what you want. Edit the script accordingly. This environment variable is used to get around the disappearing menus/mouse pointer bug.