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