Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFX Headless on Windows #113

Open
java71 opened this issue Jan 22, 2023 · 3 comments
Open

JavaFX Headless on Windows #113

java71 opened this issue Jan 22, 2023 · 3 comments

Comments

@java71
Copy link

java71 commented Jan 22, 2023

Hi,

I am developping a server application that processed images : creating bitmap images for instance...
Of course, my objective is to get a cross-platform single jar file!
I use Full LIBERICA NIK v22.3 on WINDOWS 11.

Everything works well when I use standard Liberica native image on Windows but fails on LINUX because of 'no display' !
So, if my understanding is correct, I need to use JavaFX with spcial 'MONOCLE' configuration...

  • Is it the right way ?

Again, if my reading is correct I can use MONOCLE configuration by applying arguments as follows
-Dtestfx.robot=glass
-Dglass.platform=Monocle
-Dmonocle.platform=Headless
-Dprism.order=sw

But it fails ! Error is "Failed to load Glass factory class".

So my questions are :

  • Does LIBERICA include MONOCLE capabilities ?
  • Is is possible to use it on LINUX (without display) ? on windows ?
  • Is there any tutorial for testing LIBERICA JavaFX with headless configuration ?

Thanks a lot for your help

@AlexanderScherbatiy
Copy link
Collaborator

AlexanderScherbatiy commented Jan 23, 2023

Liberica jdk contains monocle only for Linux arm32 platform.
For example, bellsoft-jdk17.0.6+10-linux-arm32-vfp-hflt-full.tar.gz includes the following monocle shared libraries:

ls jdk-17.0.6-full/lib/lib*monocle*
jdk-17.0.6-full/lib/libglass_monocle_epd.so 
jdk-17.0.6-full/lib/libglass_monocle_x11.so
jdk-17.0.6-full/lib/libglass_monocle.so 
jdk-17.0.6-full/lib/libprism_es2_monocle.so

One way to run JavaFX applications without display on Linux is using X virtual framebuffer.
In docker it looks like:

docker pull winstonpro/ubuntu-desktop
docker run --rm -v /tmp/mount:/root/mount -it winstonpro/ubuntu-desktop bash
docker ps
docker exec -it <container-id> bash
apt update
apt  install -y mesa-utils and libgl1-mesa-glx
apt install xvfb
Xvfb :99 &
export DISPLAY=:99
jdk-11.0.18-full/bin/java  -Dprism.order=sw HelloWorld

@java71
Copy link
Author

java71 commented Jan 23, 2023

Thanks for your reply !
By the way, my objective is to use NIK (native-image) in order to have a single executable file gathering whole project...
Is there any plan/roadmap for integrating MONOCLE into LIBERICA for other platform ?

@java71
Copy link
Author

java71 commented Jul 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants