Ask Your Question

HeadlessException when installing NetBeans

asked 2016-07-13 09:43:13 -0500

TIernanW gravatar image


I downloaded NetBeans 8.1 from the NetBeans website as a .sh file. I followed the instructions and executed it but I got the following:

Configuring the installer... Searching for JVM on the system... Extracting installation data... Running the installer wizard... Can`t initialize UI Running in headless mode

Exception: java.awt.HeadlessException thrown from the UncaughtExceptionHandler in thread "main"

I then tried to download the official JRE from Oracle as .tar.gz into my Downloads folder and executed:

tar zxvf jre-8u91-linux-x64.tar.gz

This extracted everything and that's where Oracle's instructions ended, but I'm new to using the Linux terminal so is that the JRE installed properly? I tried running the NetBeans installer again but it gave the same error.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-07-25 10:53:50 -0500

I appears that you are setup to run the "headless" version of Java, which means it is missing the ability to display graphics or a graphic user interface, so it can't run the NetBeans installer. You need to install or activate the regular version of Java. You did that with the Oracle download, but just extracting it won't get it setup so it will use that version when you run the NetBeans installer.

You can see which Fedora Java packages you have installed with this command:

dnf list installed java*

If you only have the "headless" package installed, you need to install the regular version:

sudo dnf install java-1.8.0-openjdk

To see all your options:

dnf search openjdk

If you already have the full version installed, you need to activate it:

sudo update-alternatives --config java

If you want to activate the Oracle version instead (not necessary), follow the instructions here:

Let me know if you get stuck.

edit flag offensive delete link more

answered 2017-07-14 01:35:47 -0500

before begine the installation:
xhost +
install netbeans like always do, when it has finished:
xhost -
Now at /usr/share/applications write this:
su -c "vi netbeans.desktop"
[Desktop Entry]
Name=NetBeans IDE 8.2
Comment=The Smarter Way to Code
Exec=/bin/sh "/usr/local/netbeans-8.2/bin/netbeans"

Then save:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-07-13 09:43:13 -0500

Seen: 2,261 times

Last updated: Jul 14 '17