Apache NetBeans IDE requires Java 8 or later Java Development Kit installed on your system.
To install Java on your system, execute following command
sudo apt install default-jdk
We use snap package to install Netbeans IDE on Ubuntu Linux system.
The latest Ubuntu system have default Snapd installed for application installation.
Open a terminal on your system and run the following command to install Netbeans IDE
sudo snap install netbeans --classic