Install NetBeans on Ubuntu 16.04 / 17.10 / 18.04 with Oracle JDK 8

How to Install NetBeans on Ubuntu 16.04 / 17.10 / 18.04 with Oracle JDK 8 Support

If you’re going to be developing applications based on Java and you need a great development platform to manage your codes, NetBeans might be a great please to start…

This brief tutorial is going to show students and new users how to easily install NetBeans IDE on Ubuntu 16.04 / 17.10 / 18.04 desktop… This post can also be applied to previous and future releases of Ubuntu.

For those who don’t know about NetBeans, it’s an open source code editor based on Java that enables anyone to develop applications for desktop, mobile, web in Java, PHP, C/C++, XML, HTML, JavaScript and many other platforms.

The layout is great, the features are many and it should allow developers to create great applications with ease.

For more about NetBeans, please check this link.

Since NetBeans is based on Java and requires Java in order to function, you must first install Java JDK 8 on Ubuntu…. NetBeans doesn’t fully support JDK 9… so you must install version 8 instead… To install Oracle JAVA JDK 8 on Ubuntu, follow the steps below…

Step 1: Install Oracle Java JDK 8

The easiest way to install Oracle Java JDK 8 on Ubuntu is via a third party PPA… To add that PPA, run the commands below

sudo add-apt-repository ppa:webupd8team/java

After running the commands above, you should see a prompt to accept the PPA key onto Ubuntu… accept and continue

Now that the PPA repository has been added to Ubuntu, run the commands below to download Oracle Java 9 installer…. the installer should install the latest Java JDK 9 on your Ubuntu machines.

sudo apt update
sudo apt install oracle-java8-installer

When you run the commands above you’ll be prompted to access the license terms of the software… accept and continue..

oracle java 9

Set Oracle JDK8 as default, to do that, install the oracle-java8-set-default package. This will automatically set the JAVA env variable.

sudo apt install oracle-java8-set-default

The command above will automatically set Java 9 as the default… and that should complete your installation, you can check you java version by running following command.

javac -version

Step 2: Downloading NetBeans

After installing Java JDK to your system, run the commands below to download NetBeans 8.2…

cd /tmp && wget -c

Wait until the complete package is downloaded to your machine… it should download to the /tmp directory…

Step 3: Install NetBeans

After downloading the installer package, while still in the /tmp directory, run the commands below to install.

chmod +x 
sudo ./

After running the commands above, run the commands below to begin the installation.

You should then see NetBeans installation wizard started. The default choices should be just fine. You don’t have to customize too much. However, if you know what you’re doing, you can customize all you want.

netbeans install ubuntu wizard

Follow the wizard until you’re done.

Select the default installation directory to install NetBeans

netbeans ubuntu java

Then NetBeans installation should continue. If the installer can’t find where Java JDK is installed, you will have to browse to find it. The default location on Ubuntu is stored at /usr/lib/jvm/java-8-oracle

oracle java netbeans

Continue and click Install to finish the installation.

After installing, launch the application and begin building great applications.

How to uninstall NetBeans?

There will be a file named in /usr/local/netbeans-x.x if you installed netbeans with root privilege. If you installed it with a normal user account the netbeans-X.X folder will be in your home directory. (Here x.x refers to the version number such as 7.2 or 8.2 etc)

Open a terminal and go to netbeans’ installation directory using cd command. Such as cd /usr/local/netbeans-x.x.

Use ‘su’ to become superuser (type in your root password). or Use “sudo”

Then execute file with the command sh

Alternatively, You can double click on it and choose “run in terminal” option. You need to supply the password (admin user’s) to do this.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

Up ↑

%d bloggers like this: