Showing posts with label headlessexception. Show all posts
Showing posts with label headlessexception. Show all posts

Java HeadlessException error

Hi there,

According to the officiaj java documenation:
[public class HeadlessException extends UnsupportedOperationException]
Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse.

Error has been noticed on Ubuntu system when running some app from command line.

Quick fix:
1. sudo apt-get install default-jre
2. sudo apt-get install default-jre-headless

Works fine after that but one downside:
From now on the system is using default OpenJDK java version!

Don't you worry, follow the instruction in the post about updating alternatives for Java in Linux based system:
update-alternatives system configuration for JAVA


Cheers!