> I'm trying to run a standalone application on solaris machine
> ,encountered the following problem. How to go about it.
>
> Exception in thread "main" java.lang.InternalError: Can't connect to
> X11 window server using ':0.0' as the value of the DISPLAY variable.
This really isn't a Java issue. The error message means that the
application tried to connect to the X server (i.e. the display), but
one of the following prevented it:
- you are not running an X server on your solaris box, but your
DISPLAY variable ":0.0" is telling the application that you are.
- you are running an X server (maybe on another machine), but ":0.0"
is not the correct DISPLAY value, so the application fails to
connect to the server.
- there is an X server running and the DISPLAY variable is correct,
however you are not authorized to connect to the server, either
because it is owned by another user or because you have not
configured your environment correctly.
If you don't think the program actually needs a GUI, you can specify
the following when you run the application:
-Djava.awt.headless=true
See also:
http://java.sun.com/j2se/1.5.0/docs/guide/awt/AWTChanges.html#headless
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Morten Alver - 27 Apr 2006 10:42 GMT
>>I'm trying to run a standalone application on solaris machine
>>,encountered the following problem. How to go about it.
[quoted text clipped - 10 lines]
> because it is owned by another user or because you have not
> configured your environment correctly.
I've typically run into this (on Linux) when trying to run a graphical
application as root. Many Linux distros are by default set up to
disallow the root user from accessing the X server; perhaps the same is
true for Solaris.
--
Morten
Gordon Beaton - 27 Apr 2006 10:49 GMT
> I've typically run into this (on Linux) when trying to run a
> graphical application as root. Many Linux distros are by default set
> up to disallow the root user from accessing the X server; perhaps
> the same is true for Solaris.
Of course, because X authorization doesn't know who is trying to
connect (it's just a socket connection), so there's no way to give
special privileges to root.
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e