java.awt.HeadlessException thrown from HeadlessGraphicsEnvironment.getDefaultScreenDevice

后端 未结 2 887
盖世英雄少女心
盖世英雄少女心 2021-01-20 05:01

I need to do some image processing on a java server (Debian with java version \"1.6.0_12\"), and I am receiving java.awt.HeadlessException from my code:

java         


        
相关标签:
2条回答
  • 2021-01-20 05:37

    Your code appears to be getting the default graphics device configuration on a machine that doesn't have a usable graphic device. This doesn't make much sense, and is never going to work.

    If you could explain why you are trying to do this (on a headless machine) we might be able to offer an alternative.

    0 讨论(0)
  • 2021-01-20 05:47

    When headless you don't have a screen device. The documentation is clear:

    Throws: HeadlessException - if isHeadless() returns true

    0 讨论(0)
提交回复
热议问题