java.awt.HeadlessException - No X11 DISPLAY variable was set, but this program performed an operation which requires it
<p>I am using Ubuntu 12.04 machine installed with java8 version. I've installed 389 Ldap server, but when I am trying to execute command <code>389-console</code>, iam getting below error:</p>

<pre><code>Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:204)
    at java.awt.Window.&lt;init&gt;(Window.java:536)
    at java.awt.Frame.&lt;init&gt;(Frame.java:420)
    at java.awt.Frame.&lt;init&gt;(Frame.java:385)
    at javax.swing.JFrame.&lt;init&gt;(JFrame.java:189)
    at com.netscape.management.client.console.Console.&lt;init&gt;(Unknown Source)
    at com.netscape.management.client.console.Console.main(Unknown Source)
</code></pre>

<p>I even ran command <code>DISPLAY=:0.0</code>, but still getting above error only while executing <code>389-console</code></p>

<p>Please tell me how to fix above?</p>