Does javax.swing need X11 on Unix?

Discussion in 'Java' started by sakcee@gmail.com, May 3, 2007.

  1. Guest

    Hi

    this question might as well be that "does OS needs processor to run "
    but anyway

    Does javax.swing needs X11 on the unix platform? I have a machine
    which havs just barebone Unix with no windowing system and although
    the calls to javax.swing.UIMangere is in catch all block, it still
    crashes that it "Can't connect to X11 window server using".

    what I am wondering is that how can it trick the catch all , and does
    swing needs windowing system to run.

    thanks
     
    , May 3, 2007
    #1
    1. Advertising

  2. Tom Hawtin Guest

    wrote:
    >
    > Does javax.swing needs X11 on the unix platform? I have a machine
    > which havs just barebone Unix with no windowing system and although
    > the calls to javax.swing.UIMangere is in catch all block, it still
    > crashes that it "Can't connect to X11 window server using".


    Are you expecting it to do some ASCII art? ;)

    Sun's AWT X implementation requires X "client" libraries: xlib. I'm not
    entirely sure of the exact details. You will also need to have the
    DISPLAY environment variable pointing to a working X Server. The X
    Server need not be on the same machine, but you need to be able to
    connect to it. For instance, I sometimes run Java programs on my Ubuntu
    machine, but displaying on my Vista laptop.

    You don't technically need a desktop environment (e.g. KDE, GNOME, RoX)
    or even a window manager (e.g. metacity, sawfish, fvwm, twm) (although
    you wont get window frames, unless you explicitly get Swing (the PL&F)
    to draw them).

    Older versions also required the Motif library. I think for 1.5 this is
    the default on Solaris but not on Linux (google for AWT_TOOLKIT).

    Tom Hawtin
     
    Tom Hawtin, May 3, 2007
    #2
    1. Advertising

  3. "Tom Hawtin" <> wrote in message
    news:463a6655$0$8714$...
    | wrote:
    | >
    | > Does javax.swing needs X11 on the unix platform? I have a machine
    | > which havs just barebone Unix with no windowing system and although
    | > the calls to javax.swing.UIMangere is in catch all block, it still
    | > crashes that it "Can't connect to X11 window server using".
    |
    | Are you expecting it to do some ASCII art? ;)
    |
    | Sun's AWT X implementation requires X "client" libraries: xlib. I'm not
    | entirely sure of the exact details. You will also need to have the
    | DISPLAY environment variable pointing to a working X Server. The X
    | Server need not be on the same machine, but you need to be able to
    | connect to it. For instance, I sometimes run Java programs on my Ubuntu
    | machine, but displaying on my Vista laptop.
    |
    | You don't technically need a desktop environment (e.g. KDE, GNOME, RoX)
    | or even a window manager (e.g. metacity, sawfish, fvwm, twm) (although
    | you wont get window frames, unless you explicitly get Swing (the PL&F)
    | to draw them).
    |
    | Older versions also required the Motif library. I think for 1.5 this is
    | the default on Solaris but not on Linux (google for AWT_TOOLKIT).

    Also, if you just want to run Java without a display at all and are trying
    to get around any GUI or Font requirements, look into Xvfb--X virtual frame
    buffer. It gives you an X Server that you can direct Java to, but does not
    actually display anything. I've used this when I've had servlets doing
    headless rendering, but that was quite a number of years ago--there may be
    better techniques available now.

    Cheers,
    Matt Humphrey http://www.iviz.com/
     
    Matt Humphrey, May 4, 2007
    #3
  4. Daniel Pitts Guest

    On May 3, 5:57 pm, "Matt Humphrey" <> wrote:
    > "Tom Hawtin" <> wrote in message
    >
    > news:463a6655$0$8714$...| wrote:
    >
    > | >
    > | > Does javax.swing needs X11 on the unix platform? I have a machine
    > | > which havs just barebone Unix with no windowing system and although
    > | > the calls to javax.swing.UIMangere is in catch all block, it still
    > | > crashes that it "Can't connect to X11 window server using".
    > |
    > | Are you expecting it to do some ASCII art? ;)
    > |
    > | Sun's AWT X implementation requires X "client" libraries: xlib. I'm not
    > | entirely sure of the exact details. You will also need to have the
    > | DISPLAY environment variable pointing to a working X Server. The X
    > | Server need not be on the same machine, but you need to be able to
    > | connect to it. For instance, I sometimes run Java programs on my Ubuntu
    > | machine, but displaying on my Vista laptop.
    > |
    > | You don't technically need a desktop environment (e.g. KDE, GNOME, RoX)
    > | or even a window manager (e.g. metacity, sawfish, fvwm, twm) (although
    > | you wont get window frames, unless you explicitly get Swing (the PL&F)
    > | to draw them).
    > |
    > | Older versions also required the Motif library. I think for 1.5 this is
    > | the default on Solaris but not on Linux (google for AWT_TOOLKIT).
    >
    > Also, if you just want to run Java without a display at all and are trying
    > to get around any GUI or Font requirements, look into Xvfb--X virtual frame
    > buffer. It gives you an X Server that you can direct Java to, but does not
    > actually display anything. I've used this when I've had servlets doing
    > headless rendering, but that was quite a number of years ago--there may be
    > better techniques available now.
    >
    > Cheers,
    > Matt Humphrey ://www.iviz.com/


    You can start Java in headless mode too. There are a lot of operations
    you CAN do in headless mode.
     
    Daniel Pitts, May 4, 2007
    #4
  5. Tom Hawtin Guest

    Daniel Pitts wrote:
    > On May 3, 5:57 pm, "Matt Humphrey" <> wrote:
    >>
    >> Also, if you just want to run Java without a display at all and are trying
    >> to get around any GUI or Font requirements, look into Xvfb--X virtual frame
    >> buffer. It gives you an X Server that you can direct Java to, but does not
    >> actually display anything. I've used this when I've had servlets doing
    >> headless rendering, but that was quite a number of years ago--there may be
    >> better techniques available now.


    > You can start Java in headless mode too. There are a lot of operations
    > you CAN do in headless mode.


    Prior to 1.4 you needed xvfb on Unix machines without access to real X
    Servers. Windows machines don't have this problem.


    Headless AWT support from 1.4:

    http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html#headless


    Tom Hawtin
     
    Tom Hawtin, May 4, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nebojsa Topolscak
    Replies:
    3
    Views:
    585
    Jon Caldwell
    Jan 14, 2005
  2. Replies:
    1
    Views:
    804
    Esmond Pitt
    Mar 27, 2005
  3. lizard
    Replies:
    0
    Views:
    1,801
    lizard
    Jan 30, 2006
  4. S.T
    Replies:
    2
    Views:
    607
  5. Andrew
    Replies:
    14
    Views:
    1,569
    Andrew
    Jan 15, 2010
Loading...

Share This Page