Help with JAVA, trying to unpack a program.

I’m trying to unpack and install a program with JAVA on the command line but when I type “sudo java -jar…etc” it gives me this:

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:207)
        at java.awt.Window.<init>(Window.java:535)
        at java.awt.Frame.<init>(Frame.java:420)
        at java.awt.Frame.<init>(Frame.java:385)
        at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1755)
        at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1830)
        at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1697)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:863)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
        at com.izforge.izpack.installer.GUIInstaller.showFatalError(Unknown Source)
        at com.izforge.izpack.installer.GUIInstaller.<init>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:374)
        at com.izforge.izpack.installer.Installer.main(Unknown Source)
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.birosoft.liquid.LiquidLookAndFeel.loadIconImmediately(LiquidLookAndFeel.java:903)
        at com.birosoft.liquid.LiquidLookAndFeel.loadIcon(LiquidLookAndFeel.java:881)
        at com.birosoft.liquid.LiquidLookAndFeel.initComponentDefaults(LiquidLookAndFeel.java:685)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:536)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:580)
        at com.izforge.izpack.installer.GUIInstaller.loadLookAndFeel(Unknown Source)
        at com.izforge.izpack.installer.GUIInstaller.init(Unknown Source)


Does anyone know what might be the problem? this is kinda frustrating, I hope someone knows.

On 2014-01-07 04:06, theuniverse wrote:

> Code:
> --------------------
> java.awt.HeadlessException:
> No X11 DISPLAY variable was set, but this program performed an operation which requires it.

> --------------------
>
>
> Does anyone know what might be the problem? this is kinda frustrating, I
> hope someone knows.

You have to run it on a terminal in graphical mode, that’s one. And if
that is not enough, you need to use “su -”, not sudo - if it is going to
be a system program; if it is going to be installed on your home, use
neither sudo nor su.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

thanks. How do I run the terminal on graphical mode?

On 2014-01-07 05:06, theuniverse wrote:
>
> thanks. How do I run the terminal on graphical mode?

Main menu, System, click on any of the terminal entries, choose the one
you like.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I finally got it to work, the thing is I had installed the JAVA plugin for firefox from a tar archive and removed Icedtea along with OpenJDK, so I just reinstalled OpenJDK and typed the “java -jar” command without being root and it worked like a charm.

I just hope there won’t be a conflict between Icedtea and JAVA on firefox, because Icedtea simply didnt work for me.