SystemTray not supported on Windows 10

家住魔仙堡 提交于 2019-12-02 02:25:45

问题


With Java 8 sdk, when I do

if (SystemTray.isSupported()) {
   logger.error("SystemTray IS supported");
} else {
    logger.error("SystemTray IS NOT supported");
}

Why SystemTray is not supported on Windows 10 ?

And what can I do to make it supported ?

Thanks


回答1:


You can set headless property from code too:

System.setProperty("java.awt.headless", "false");



回答2:


I found the problem! My JVM was just starting in HeadLess mode!

I do not understand why... maybe because I do not have any GUI excepted this icon.

TO deactivate Headless mode, start the program with -Djava.awt.headless=false



来源:https://stackoverflow.com/questions/42420903/systemtray-not-supported-on-windows-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!