NetBeans is an open-source IDE (Integrated Development Environment) for developing and modifying applications based on Java, PHP, JavaScript, C++, and some other programming languages. It also helps to develop enterprise-level applications which need fully-featured interfaces. NetBeans can be installed and used on all OS platforms which support Java like Linux, Windows, MacOS, etc. It has got various features including built-in debugging support, error checking, syntax highlighting, code completion, etc.
If you need to install NetBeans on your Ubuntu OS, you can do so using different ways. In this post, we will cover:
- Installing NetBeans using apt (Command Line)
- Installing NetBeans using Software Center (GUI)
This post has been written for Ubuntu 20.04 LTS (Focal Fossa).
Pre-requisite: Install Java
For NetBeans, you will need Java 8 or later to be installed on the system. To install Java on your system, launch the Terminal, and execute this command:
$ sudo apt install openjdk-8-jdk
Enter the sudo password and then it will start installing Java on your system.
Once installed, you can verify the installation of Java using this command:
$ java -version
The following output verifies that java has been successfully installed on or system.
Method#1 Installing NetBeans using apt (Command Line)
The easiest way to install NetBeans is using the apt utility. This method installs the older version of NetBeans that is version 10.
1. First, enable the universe repository using this command in Terminal:
$ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu focal universe"
2. Update the repository index using the following command:
$ sudo apt update
3. Now, in order to install NetBeans in your system, use this command:
$ sudo apt install netbeans
Now the installation of NetBeans will be started. It can take a bit of time depending upon your connection speed.
Once NetBeans is installed, you are ready to use it.
Method#2 Installing NetBeans using Software Center (GUI)
NetBeans can also be installed via Ubuntu Software Center. This method installs the latest version of NetBeans that is version 12.3.
1. Launch Software Center in your system. You can launch it by searching it from the Dash menu.
2. In the Software Center window, click the search icon and type netbeans in it. From the search results, click the Apache NetBeans icon as can be seen in this screenshot.
After clicking the Apache NetBeans icon, you will see an Install button under it. Click it to install NetBeans on your system.
Then it will prompt you to enter the password for authentication. Enter the password and then the installation of NetBeans will be started. It can take a bit of time depending upon your connection speed.
Once NetBeans is installed, you are ready to use it.
Launch NetBeans
In order to launch NetBeans, hit the super key and type netbeans in the search bar. When the search result appears, click the NetBeans icon to launch it.
You will see the following default view of NetBeans.
Remove NetBeans
In case, you no longer need NetBeans on your system, you can remove it as follows:
$ sudo apt remove netbeans
If you have installed NetBeans via Ubuntu Software Center, you can remove it as follows:
Launch Software Center from the Dash menu. In the Software Center Installed tab, look for NetBeans applications. Now to remove the NetBeans application, click the Remove button. Then enter the authentication password and click the Authenticate button. Now NetBeans will be removed from your system.
This post covered two different methods for the installation of NetBeans on Ubuntu OS. You can use any installation method (command line or via GUI-based method) that is most convenient for you. However, remember the apt install the older version 10 of NetBeans while the Software Center installs the latest version 12.3.