How to Install NetBeans in Ubuntu Desktop

The NetBeans IDE is a free, open source, Java based Integrated Development Environment (IDE) which can be downloadable for different technologies, including Java, PHP, JavaScript, C/C++, HTML, and others.

In this tutorial I will explain how to install NetBeans IDE in Ubuntu 16.04. The current version is NetBeans 8 and available from the Ubuntu apt repository.

Best and recommended method is to install NetBeans using the apt-get command:

sudo apt-get update
sudo apt-get install netbeans

The apt-get command will automatically install all dependent packages needed by NetBeans IDE.

How to Install NetBeans in Ubuntu Desktop

Manually Download and Install NetBeans for other Programming Languages

It is also possible to install NetBeans manually from the package provides by the netbeans website and different packages available for different programming languages.

The following steps will guide you to manually download and install Java and NetBeans IDE on Ubuntu Desktop:

  1. Install Java Development Kit.
  2. Download NetBeans IDE for Ubuntu.
  3. Make the downloaded file executable.
  4. Execute the .sh file.

First, install the openjdk-8-jdk-headless package which provides JDK 8 for Ubuntu:

sudo apt-get update
sudo apt-get install openjdk-8-jdk-headless

To download NetBeans IDE for Ubuntu, go to following URL https://netbeans.org/downloads/ and download the package for your programming language (I am going to use the bundle that support all languages).

For Ubuntu, NetBeans is downloaded in the form of a shell script. The filename should be something similar to "netbeans-8.2-linux.sh".

So first we must make the downloaded file to be executable using the chmod command:

chmod +x netbeans-8.2-linux.sh

To continue with the installation on Ubuntu, execute the .sh file from the command line:

sudo ./netbeans-8.2-linux.sh
Manually Download and Install NetBeans for other Programming Languages

Creating a Java application

  1. To start a new Java project, Click on File and then click on New Project.
  2. Select Java Application by going to Categories.
  3. Enter Project Name and select the location of the project folder.
  4. Click on Finish.