graphic process in unix


i've developed an web-base application which creates vertial title images in runtime with java.awt libaries. it works fine in windows
but it does not work in my sun solaris 10. i searched the error in web and found two solutions;
      first one: using -Djava.awt.headless=true in startup script but when i try i get this error;
                        ERROR 2007-09-19 12:09:54,527 - java.awt.HeadlessException
      second one: using xwindow like this;                        
                        export DISPLAY
                        but i get this error; (i think i set the wrong port, how can i get the xwindow port?)
                        <Jun 19, 2008 12:07:56 PM EEST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=28914982,name=NewDMWEB,context-path=/NewDMWEB)] Root cause of ServletException.
                        java.lang.InternalError: Can't connect to X11 window server using 'localhost:10' as the value of the DISPLAY variable.
                              at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
                              at sun.awt.X11GraphicsEnvironment.<clinit>(
                              at java.lang.Class.forName0(Native Method)
                              at java.lang.Class.forName(
                              at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(
                              at java.awt.Font.initializeFont(
                              at java.awt.Font.<init>(

how can i run the application?

thanks in advance...
Who is Participating?
janavarConnect With a Mentor Author Commented:
i fixed the problem by using pja toolkit ( but it does not support java 1.5 or above :-(
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
a) Using "headless" means that you do not have any graphical display at all
b) To use an X11 display you must
    - Have an X11 display server up and runing (X11 started on some workstation)
      This could be a local X11 display on your Solaris workstation or any other
       display somewhere on the network.
    - The environment variable $DISPLAY must be set to point to this very display
       If you have a local display (on your Solaris 10 workstation) it will usually be
       set to something like
       You may verify this right after starting an xterm (or some other shell window)
       and entering
           echo $DISPLAY
       If you have a remote X11 display, it would be set to something like
       or to
           localhost:10.0    (or simply localhost:10)
       when you logged in to your Solaris 10 box via ssh with X11 tunneling enabled.
       When using cygwin as the X11 display (server), you must (!) omit the .0 at the
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
To verify if you can use the DISPLAY variable as it is set right now,
try to open some X11 application like
    xterm -ls -sl &
( or, if your PATH is not set:
    /usr/openwin/bin/xterm -ls -sl &
) or
    xclock -update 1 &

janavarAuthor Commented:
i am connecting to the server with telnet so i can not execute xterm. how can i test if xwindow works fine and which port it listens?
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
when you got an term opened, check the DISPLAY variable
    echo $DISPLAY
Now, try to start another X11 program (like xterm, xclock etc.)
and see if it gets displayed on your screen.

X11 usually listens on ports 5000 and above
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.