1

While trying to install Netbeans 8.0 in my Ubuntu 14.04 I get the following error:

Can`t initialize UI Running in headless mode
Exception: java.awt.HeadlessException thrown from the
UncaughtExceptionHandler in thread "main"

I have previously installed openjdk 7 and yet it's not working for some reason.

0

3 Answers 3

0

You do not have to uninstall OpenJDK in order to install Netbeans. Some programs may depend on it, and removing OpenJDK will remove them too. The most system harmless solution is to explicitly declare the Java home for the Netbeans install, by typing:

sudo bash netbeans-8.0.2-linux.sh --javahome /path/to/jdk1.X.X_XX
0

Searching the internet I found that the problem is with openjdk's support with the UI.

The solution is pretty simple.

  1. Uninstall openjdk
  2. Install oracle jdk
  3. Reinstall Netbeans

Use the following commands:

sudo apt-get remove openjdk*   
sudo add-apt-repository ppa:webupd8team/java  
sudo apt-get update  
sudo apt-get install oracle-java7-installer  
sudo apt-get install oracle-java7-set-default

And install* Netbeans again, this should fix the problem.

*Usually via bash, for example: bash netbeans-8.0

0

I have got same error message but after installing of openjdk-7-jdk Netbeans was installed without any issues.

sudo apt-get install openjdk-7-jdk

Not the answer you're looking for? Browse other questions tagged .