JavaFx in headless mode

后端 未结 5 2042
抹茶落季
抹茶落季 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:13

    Answer by Shreyas Dave didn't work for me anymore. Though I don't know why, here is what I did:

    public static void main(String[] args) {
        // to avoid
        // [JRSAppKitAWT markAppIsDaemon]: Process manager already initialized: can't fully enable headless mode.
        System.setProperty("javafx.macosx.embedded", "true");
        java.awt.Toolkit.getDefaultToolkit();
        // end
        launch(args);
    }
    

    This was also pointed out here: JavaFX screencapture headless exception on OSX

提交回复
热议问题