Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX crashes X Server

Tags:

javafx-2

xorg

Background/Context:

I'm currently developing a touch screen application which is aimed to run on Linux. As a development framework I chose JavaFX (jdk1.7.0_10) due to its rapid prototyping easiness. I'm using Arch Linux (kernel 3.6.10-1-ARCH) distribution and since JavaFX needs a head-full environment to run, I installed Xorg on top of the base configuration. Even thought I'm able to run my JavaFX application, I have some issues with popup windows that are being displayed in my application.

When trying to display those popup windows, sometimes they don't respond as expected or event worse, they crash my application. The error I get is the following:

The program 'java' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
(Details: serial 51101 error_code 9 request_code 62 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

By the way, when running the same application on Windows (my development machine), everything works fine.

I also tried to run a composite manager ('xcompmgr') since i was also getting some warnings like

Can't create transparent stage, because your screen doesn't support alpha channel. You need to enable XComposite extension.

but it didn't helped.

Question:

Am i missing some files or configurations in order to run smoothly JavaFX in Linux, or has any one encountered the same challenge? Since my main concern is performance (due to limited hardware specs), I don't want to install a full featured Linux distribution. I only need to run my JavaFX application.

like image 739
user1913216 Avatar asked Oct 22 '22 21:10

user1913216


1 Answers

Try running JavaFX in software rendering mode: java -Dprism.order=j2d -jar your.jar

Also note that your platforms seems to be not included into list of supported ones: http://www.oracle.com/technetwork/java/javafx/downloads/supportedconfigurations-1506746.html

like image 58
Sergey Grinev Avatar answered Oct 25 '22 18:10

Sergey Grinev