When we are trying to get the Clipboard instance.
Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard();
Also i have tried to run the Spring boot application by setting the head.
SpringApplicationBuilder builder = new SpringApplicationBuilder(SpringBootApplication.class,args);
builder.headless(false).run(args);
we are getting below exception.
java.awt.HeadlessException
at sun.awt.HeadlessToolkit.getSystemClipboard(HeadlessToolkit.java:309)
at com.kpit.ecueditor.core.utils.ClipboardUtility.copyToClipboard(ClipboardUtility.java:57)
Can someone suggest me what i am missing here.
If i run the same clipboard code in simple java application , it is working but not in the spring boot application.