title: Setup Linux desktop / GUI environment
body: <p><code>Android</code> build upon a <code>Linux kernel</code> and most Linux systems use a desktop environment like <code>GNOME</code>, <code>KDE</code>, <code>LXDE</code> etc.</p>
  
  <p>I have compiled Linux kernel and minimal root file system build with <code>busybox</code>, <code>arm cross compiler</code> tool-chain and <code>arm-J2SE</code>. Currently I have the basic <code>Command Line Interface</code>. Now I want to use a desktop environment (<strong>enable mouse and handle mouse or touchscreen inputs/events</strong>). Because my java command line codes running fine but when I am using <code>swing</code> or <code>awt</code> application it shows this exception. </p>
  
  <pre><code>Exception in thread "main" java.awt.HeadlessException at
           java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
  at java.awt.Window.&lt;init&gt;(Window.java:535)
  at java.awt.Frame.&lt;init&gt;(Frame.java:420)
  at javax.swing.JFrame.&lt;init&gt;(JFrame.java:224)
  at Gui.main(Gui.java:7)
  </code></pre>
  
  <p>Just I have a look on <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/HeadlessException.html" rel="nofollow">javadoc</a> and It shows,</p>
  
  <pre><code>public class HeadlessException
          extends UnsupportedOperationException
  </code></pre>
  
  <p><code>Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse.</code></p>
  
  <p>Basically it need some window management or GUI like environment. I found few library for building a GUI environment like <code>XLIB/X11,SDL</code> which can manage those mouse and touch screen events. Can any one tell me where to start to achieve my goal. Few Linux system use <code>startx</code> command to enable GUI environment then brought the desktop,window,mouse etc. I need some thing like this to run my java gui applications. Could any one lead me a way.</p>