Results 1 to 2 of 2

Thread: java.awt.HeadlessException and then java.lang.InternalError

  1. #1
    Senior Member registered user
    Join Date
    Dec 2004
    Posts
    168

    java.awt.HeadlessException and then java.lang.InternalError

    I am unsuccessfully trying to run a very simple java applet that is giving me java Exceptions and Errors
    ~
    The thing is that I would like to be able to edit and run the JApplet in the console Window that lets me copy and paste errors dumped on the screen
    ~
    or how could you copy some text off the screen and paste onto a document opened using kate
    ~
    import javax.swing.JFileChooser;
    import javax.swing.JApplet;

    public class FileChooserTest00 extends JApplet{
    // __
    public void init(){ JFileChooser fileChooser = new JFileChooser(); }
    // __
    public static void main(String[] args){
    FileChooserTest00 fileChooserTest = new FileChooserTest00();
    fileChooserTest.init();
    }
    }

    root@Knoppix:/home/root# appletviewer FileChooserTest00.html
    ~
    Warning: Can't read AppletViewer properties file: /root/.hotjava/properties Using defaults.
    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(Graphic sEnvironment.java:159)
    at java.awt.Window.<init>(Window.java:317)
    at java.awt.Frame.<init>(Frame.java:419)
    at java.awt.Frame.<init>(Frame.java:384)
    at sun.applet.AppletViewer.<init>(AppletViewer.java:1 41)
    at sun.applet.StdAppletViewerFactory.createAppletView er(AppletViewer.java:82)
    at sun.applet.AppletViewer.parse(AppletViewer.java:11 22)
    at sun.applet.AppletViewer.parse(AppletViewer.java:10 56)
    at sun.applet.Main.run(Main.java:13
    at sun.applet.Main.main(Main.java:80)
    ~
    // __
    root@Knoppix:/home/root# DISPLAY=:0.0
    root@Knoppix:/home/root# export DISPLAY
    root@Knoppix:/home/root# echo $DISPLAY
    :0.0
    root@Knoppix:/home/root# appletviewer FileChooserTest00.html
    Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified

    Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.access$000(X11Graph icsEnvironment.java:53)
    at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEn vironment.java:142)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(X11Graphic sEnvironment.java:131)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvir onment(GraphicsEnvironment.java:6
    at java.awt.Window.init(Window.java:270)
    at java.awt.Window.<init>(Window.java:31
    at java.awt.Frame.<init>(Frame.java:419)
    at java.awt.Frame.<init>(Frame.java:384)
    at sun.applet.AppletViewer.<init>(AppletViewer.java:1 41)
    at sun.applet.StdAppletViewerFactory.createAppletView er(AppletViewer.java:82)
    at sun.applet.AppletViewer.parse(AppletViewer.java:11 22)
    at sun.applet.AppletViewer.parse(AppletViewer.java:10 56)
    at sun.applet.Main.run(Main.java:13
    at sun.applet.Main.main(Main.java:80)
    ~

  2. #2
    Senior Member registered user
    Join Date
    Apr 2005
    Posts
    159

    Re: java.awt.HeadlessException and then java.lang.InternalEr

    Quote Originally Posted by Albretch
    root@Knoppix:/home/root# appletviewer FileChooserTest00.html
    ~
    Warning: Can't read AppletViewer properties file: /root/.hotjava/properties Using defaults.
    Exception in thread "main" java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    Why are you running this as root? Simply run it from a konsole, as user "knoppix".
    If you need root privilege, issue "xhost +" from a knoppix session, to allow other accounts to use the X display.
    You also need to have the variable DISPLAY defined, "export DISPLAY=:0" shoudl do (but is unnecessary for user "knoppix").

Similar Threads

  1. Is it possible to run Java with the CD?
    By butsoccer in forum General Support
    Replies: 1
    Last Post: 05-29-2007, 09:32 AM
  2. Java
    By mystical_kakarot in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 02-10-2004, 09:20 PM
  3. Java Where is it?
    By JAlvoeiro in forum General Support
    Replies: 9
    Last Post: 08-26-2003, 09:43 PM
  4. java
    By johncarlson21 in forum General Support
    Replies: 0
    Last Post: 03-22-2003, 03:39 AM
  5. java SDK 1.4.1 from [url]www.sun.com[/url]
    By A. Jorge Garcia in forum General Support
    Replies: 1
    Last Post: 12-25-2002, 09:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Juniper SRX650 VPN Firewall Security Hub SRX650-BASE-SRE6-645AP w/SRX-GP-IM picture

Juniper SRX650 VPN Firewall Security Hub SRX650-BASE-SRE6-645AP w/SRX-GP-IM

$99.99



JUNIPER MPC5E-40G10G MPC5E CARD 6x40GE & 24x10GE, COUIBD1BAF picture

JUNIPER MPC5E-40G10G MPC5E CARD 6x40GE & 24x10GE, COUIBD1BAF

$3999.99



JUNIPER EX3400-48P 48x 1GB PoE+ RJ-45 4x 10GB SFP+ 2x 40GB QSFP+, DUAL AC POWER picture

JUNIPER EX3400-48P 48x 1GB PoE+ RJ-45 4x 10GB SFP+ 2x 40GB QSFP+, DUAL AC POWER

$210.00



Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch picture

Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch

$40.18



Juniper Networks EX4300-48T 48 Port Gigabit 4 QSFP 40G 2xPSU AFO Network Switch picture

Juniper Networks EX4300-48T 48 Port Gigabit 4 QSFP 40G 2xPSU AFO Network Switch

$89.00



Juniper Networks EX2300-C 12-Port 2XSFP Uplinks PoE+ Switch P/N: EX2300-C-12P picture

Juniper Networks EX2300-C 12-Port 2XSFP Uplinks PoE+ Switch P/N: EX2300-C-12P

$299.99



Juniper Networks EX3300-24P | 24 Port Gigabit Network Switch w/ Power cord picture

Juniper Networks EX3300-24P | 24 Port Gigabit Network Switch w/ Power cord

$53.99



Juniper EX2300-24P Poe+ Rack Mountable Ethernet Switch picture

Juniper EX2300-24P Poe+ Rack Mountable Ethernet Switch

$130.00



Juniper QFX5100-48T-AFO   48 100M/1G/10G Base-T 6 QSFP AFO picture

Juniper QFX5100-48T-AFO 48 100M/1G/10G Base-T 6 QSFP AFO

$485.00



Juniper EX2300-48P  PoE+ Switch 48x 1GbE & 4 SFP+/SFP 10G uplinks, Tested picture

Juniper EX2300-48P PoE+ Switch 48x 1GbE & 4 SFP+/SFP 10G uplinks, Tested

$289.00