JavaFx in headless mode

后端 未结 5 2040
抹茶落季
抹茶落季 2020-12-10 07:36

Is it possible to run JavaFx in headless mode(in Java 7)? It is being used to generate images on the server but is asking for an X-Server. Does there exist something like ja

5条回答
  •  悲&欢浪女
    2020-12-10 08:25

    If you have the source code of the JavaFX application you could also try to use TestFX run the application in a headless mode, to control it and to make screenshots. To run your TestFX application in headless mode you have to start it with the following JVM parameters (to enable Monocle):

    -Dtestfx.robot=glass -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw
    

    Moreover you might need to install Monocle first. See Headless testing with JavaFx and TestFx for more information.

提交回复
热议问题