java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
the
value of the DISPLAY variable.
at sun.awt.motif.MToolkit.<init>(MToolkit.java:41)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:191)
at java.awt.Window.getToolkit(Window.java:155)
at java.awt.Frame.addNotify(Frame.java:82)
at java.awt.Window.show(Window.java:106)
at Test.main(Test.java:9)
The application takes a bunch of parameters, creates a virtual image, draws
to that image and encodes that image as a GIF. It ran fine on my NT
machine but I get this error when moving the app to a Unix box. Here's my
theory:
Because I'm running this from the command line and there is no X-server
running, the app chokes when it tries to create the frame I use to create
the image. That makes sense no?
If I'm right, how can I create and manipulate this image without an
X-server?
-----------------------------------------
Jason Dorn
Senior Advisor
Information Technology Services
University of Colorado, Boulder
jd...@colorado.edu
303-492-5465
> This is a new one for me. First the error:
>
> java.lang.InternalError: Can't connect to X11 window server using ':0.0' as
> the
> value of the DISPLAY variable.
> at sun.awt.motif.MToolkit.<init>(MToolkit.java:41)
> at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:191)
> at java.awt.Window.getToolkit(Window.java:155)
> at java.awt.Frame.addNotify(Frame.java:82)
> at java.awt.Window.show(Window.java:106)
> at Test.main(Test.java:9)
>
> The application takes a bunch of parameters, creates a virtual image, draws
> to that image and encodes that image as a GIF. It ran fine on my NT
> machine but I get this error when moving the app to a Unix box. Here's my
> theory:
>
> Because I'm running this from the command line and there is no X-server
> running, the app chokes when it tries to create the frame I use to create
> the image. That makes sense no?
>
> If I'm right, how can I create and manipulate this image without an
> X-server?
>
You can't.
Even offscreen images use the native toolkit. On NT this is always
available. On unix you really need an xserver. You could try to run a vfb xserver
(virtual frame buffer, does not require actual display hardware).
An other solution would be to add the gd package through jni, but then you won't
be able to use the awt graphics.
Regards,
Harco
--
-----------------+----------------------+------------------------------
Harco de Hilster CAOS/CAMM Center Phone: +31(0)24-3653379
Research & University of Nijmegen Fax: +31(0)24-3652977
Development Toernooiveld 1 E-mail: har...@caos.kun.nl
System Management 6525 ED Nijmegen URL: http://www.caos.kun.nl
The Netherlands
-----------------+----------------------+------------------------------
Vy