Ask Your Question
0

HeadlessException when installing NetBeans

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

TIernanW gravatar image

Hey!

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
1

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

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: https://ask.fedoraproject.org/en/question/49060/how-to-make-oracle-jdk-and-jre-as-default-java-in-fedora-20/

Let me know if you get stuck.

edit flag offensive delete link more
0

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

before begine the installation:
xhost +
su
install netbeans like always do, when it has finished:
exit
xhost -
Now at /usr/share/applications write this:
su -c "vi netbeans.desktop"
[Desktop Entry]
Encoding=UTF-8
Name=NetBeans IDE 8.2
Comment=The Smarter Way to Code
Exec=/bin/sh "/usr/local/netbeans-8.2/bin/netbeans"
Icon=/usr/local/netbeans-8.2/nb/netbeans.png
Categories=Application;Development;Java;IDE
Version=1.0
Type=Application


Then save:
:x!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 2,091 times

Last updated: Jul 14 '17