Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以让 java 忽略对 X11 系统的任何代码调用?我在没有窗口管理器的服务器机器上运行应用程序。当我运行这个应用程序时,我得到了 java.awt.HeadlessException。我已经尝试设置 -Djava.awt.headless=true / System.setProperty("java.awt.headless", true)。没运气。
我真的必须手动删除与图形系统交互的所有代码行还是有更优雅的方式?谢谢。
在无头模式下使用 java Java 无头模式