You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

NetBeans is a very powerful Integrated Development Environment (IDE) tool mostly used for Java and C/C++ Development. It allows you easily develop Web, Desktop and Mobile Applications from its modular framework. You can add support for other Programming Languages such as PHP, HTML, JavaScript, C, C++, Ajax, JSP, Ruby on Rails e.t.c using extensions.

NetBeans IDE 12 has been released with support for Java JDK 11. It also comes with the following features:

  • Support for PHP 7.0 through 7.3, PHPStan and Twig.
  • Include modules in the “webcommon” cluster. I.e. All JavaScript features in Apache NetBeans GitHub are part of Apache NetBeans 10.
  • Modules in the “groovy” cluster are included in Apache NetBeans 10.
  • OpenJDK can Automatically detect JTReg from OpenJDK configuration and register the expanded JDK as a Java Platform.
  • Support for JUnit 5.3.1

Please visit the Apache NetBeans 12 page for further detail.

Install NetBeans Dependencies

Netbeans needs Java JDK to run. Since Java 11 is officially supported. In this guide will use the default supported Java version in our operating system.

To install the default Java that ships with your distribution, run:

sudo apt update
sudo apt install -y default-jdk

For Java 8, install it using commands below – Ubuntu:

sudo add-apt-repository ppa:webupd8team/java
sudo apt update 
sudo apt install oracle-java8-set-default

Confirm installed version of Java:

$ java --version
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

Step 1: Download NetBeans archive

Download the NetBeans 12 installation files.

wget https://downloads.apache.org/netbeans/netbeans/12.1/netbeans-12.1-bin.zip

Wait for the download to finish then extract it.

Step 2: Extract the file

Once the file has been downloaded extract.

unzip netbeans-12.1-bin.zip

Confirm created directory file contents:

$ ls netbeans
apisupport  cpplite       enterprise  etc     groovy   ide   javafx   licenses  netbeans.css  php       profiler     webcommon
bin         DEPENDENCIES  ergonomics  extide  harness  java  LICENSE  nb        NOTICE        platform  README.html  websvccommon

Step 3: Move netbeans folder to /opt

Let’s now move the netbeans/ folder to /opt

sudo mv netbeans/ /opt/

The Netbeans executable binary is located under /opt/netbeans/bin/netbeans. We need to add its parent directory to our $PATH so that we can launch the program without specifying the absolute path to the binary file.

Open your ~/.bashrc or ~/.zshrc file.

$ nano ~/.bashrc

Add the following line at the end of the file

export PATH="$PATH:/opt/netbeans/bin/"

Source the file to Start Netbeans without shell restart.

$ source ~/.bashrc

Install Netbeans using script

You can also the install Netbeans 12 on Linux from a script provided for download:

wget https://downloads.apache.org/netbeans/netbeans/12.1/Apache-NetBeans-12.1-bin-linux-x64.sh
sudo bash Apache-NetBeans-12.1-bin-linux-x64.sh

Step 4: Create NetBeans IDE Desktop Launcher

Credits goes to Vimbai Chatitai in the comments section who shared steps to create a launcher for Netbeans.

Create new file on /usr/share/applications/netbeans.desktop.

sudo nano /usr/share/applications/netbeans.desktop

Add below data.

[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

Step 5: Start Netbeans IDE

Now that you have downloaded and installed Netbeans IDE, you can launch it from your Applications launcher menu.

Or from the terminal like below:

$ netbeans

You should get output like this

Once the application is started, you should see default welcome page for NetBeans.

You can install available Plugins under My NetBeans > Available Plugins

Kudos!. You have successfully installed Netbeans 12 on Ubuntu, Debian and Linux Mint system.

You can also check:

How To Install Eclipse IDE on Ubuntu

Install Lightworks Video Editor on Ubuntu / Linux Mint / Debian

Best Linux Books for Beginners & Experts

Best Books for Learning Java Programming

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF