Solve the java.awt.HeadlessException in Spring boot in eclipse

Message pop-ups are not allowed for Spring Boot projects. You can use windows or HTML. Java.awt.HeadlessException: null exception will occur when pop-ups

Steps to solve java.awt.HeadlessException:

1. Delete in the startup class of springboot

SpringApplication.run(Application.class, args)

2. Replace with

SpringApplicationBuilder builder = new SpringApplicationBuilder(Application.class);
builder.headless(false).run(args);

3. In the eclipse installation directory, find the eclipse.ini file, and add at the end: -Djava.awt.headless=false. Just restart
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41936224/article/details/109470352