[英]HeadlessException in JavaFX on MacOS X with OpenJDK 10 and OpenJFX
I'm getting the error 我遇到了错误
java.awt.HeadlessException: null
at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:306) ~[na:na]
when calling 打电话时
Desktop.getDesktop().open(pdfFile);
I am using OpenJDK with this version 我在此版本中使用OpenJDK
java 10.0.2 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
and OpenJFX in javafx-sdk-11
on MacOS 10.14.2
. 和
MacOS 10.14.2
上javafx-sdk-11
中的MacOS 10.14.2
。
Why is the JVM run in headless mode here on MacOS? 为什么JVM在MacOS上以无头模式运行? How can I run it without headless mode?
没有无头模式怎么办?
The problem was not caused by OpenJDK, OpenJFX or MacOS X, but by Spring Boot. 该问题不是由OpenJDK,OpenJFX或MacOS X引起的,而是由Spring Boot引起的。
Per default Spring Boot applications are run in headless mode. 默认情况下,Spring Boot应用程序以无头模式运行。 Here's how this can be disabled:
禁用此操作的方法如下:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.