NetBeans IDE (Integrated Development Environment) is a powerful software development tool primarily used for Java and C/C++ applications. With its modular framework, you can develop Desktop, Web, and Mobile applications, and even add support for other programming languages like C, C++, HTML, PHP, JavaScript, JSP, Ajax, and Ruby on Rails using various extensions or plugins. It offers features such as error checking, code completion, built-in debugging support, and syntax highlighting.
In this article, we will guide you through the process of installing NetBeans IDE 12 on Ubuntu 20.04 using different methods. Before we begin, make sure you have the necessary prerequisites installed.
Prerequisites
Before installing NetBeans IDE, you need to have Java OpenJDK packages installed on your Ubuntu 20.04 system. Follow the steps below to install Java JDK version 8 or later:
- Update the system’s apt packages by running the following command:
sudo apt update
- Install the default Java JDK version 11 from the official apt repository by executing the command:
sudo apt installdefault-jdk
To verify the installation and check the installed Java JDK version, use the command:
java --version
Once you have installed the prerequisites, you can proceed with the installation of NetBeans IDE.
Method 1: Install NetBeans IDE using Ubuntu apt repository
The easiest way to install NetBeans IDE is through the Ubuntu apt repository. This method will install the older version, NetBeans 10, on your system. Follow the steps below to install NetBeans IDE:
- Add and enable the universe repository by running the following command:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu focal universe"
- Update the packages index by executing the command:
sudo apt update
- Install NetBeans using the apt utility:
sudo apt install netbeans
The installation may take some time depending on your internet connection speed. Once it’s finished, you can start using NetBeans IDE.
Method 2: Install NetBeans IDE by downloading the archive source code
If you want to install the latest version of NetBeans, version 12, or if you prefer to download the archive manually, follow these steps:
- Download the NetBeans 12 archive by running the following command:
sudo wget https://downloads.apache.org/netbeans/netbeans/12.4/netbeans-12.4-bin.zip
- Verify the downloaded file by running:
ls
- Extract the NetBeans zip file using the following command:
unzip netbeans-12.4-bin.zip
- List the contents of the created directory to verify the extraction:
ls netbeans
- Move the netbeans directory to the /opt directory using the command:
sudo mv netbeans/ /opt/
- Adjust the $PATH environment variable for NetBeans by opening the
~/.bashrc
file in a source code editor:
sudo nano ~/.bashrc
- Add the following line at the end of the file:
export PATH="$PATH:/opt/netbeans/bin/"
- Source the file to apply the changes:
source ~/.bashrc
- Create a desktop launcher for NetBeans IDE by executing the following command:
sudo nano /usr/share/applications/netbeans.desktop
- Paste the following lines inside the file:
[Desktop Entry]
Name=Netbeans IDE
Comment=Netbeans IDE
Type=Application
Encoding=UTF-8
Exec=/opt/netbeans/bin/netbeans
Icon=/opt/netbeans/nb/netbeans.png
Categories=GNOME;Application;Development;
Terminal=false
StartupNotify=true
- Save the file and close it.
- You can now launch NetBeans IDE from the application menu or by typing the following command in the terminal:
netbeans
Method 3: Install NetBeans IDE using snap
Alternatively, you can install NetBeans IDE using snap. To do this, follow these steps:
- Check the installed snap version by running the command:
snap version
- Install NetBeans IDE via snap by executing the following command:
sudo snap install netbeans --classic
After the installation process is complete, you can launch NetBeans IDE and start developing your projects.
Conclusion
In this article, we have covered three different methods to install NetBeans IDE on Ubuntu 20.04. You can choose the method that suits your needs and start using NetBeans for your Java and C/C++ development projects.
To learn more about NetBeans and its features, you can visit the official Apache NetBeans website. If you need reliable and scalable cloud hosting solutions, consider checking out Shape.host. They offer Linux SSD VPS services that can provide you with the performance and security you need for your applications.
Remember to always keep your development environment up to date and take advantage of the powerful features provided by NetBeans IDE. Happy coding!