Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Does javax.swing need X11 on Unix?

Thread view: 
sakcee@gmail.com - 03 May 2007 23:21 GMT
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
Tom Hawtin - 03 May 2007 23:48 GMT
> 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
Matt Humphrey - 04 May 2007 01:57 GMT
| > Does javax.swing needs X11 on the unix platform? I have a machine
| > which havs just barebone Unix with no windowing system and although
[quoted text clipped - 17 lines]
| 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 matth@ivizNOSPAM.com http://www.iviz.com/
Daniel Pitts - 04 May 2007 02:11 GMT
> | > Does javax.swing needs X11 on the unix platform? I have a machine
> | > which havs just barebone Unix with no windowing system and although
[quoted text clipped - 27 lines]
> Cheers,
> Matt Humphrey m...@ivizNOSPAM.comhttp://www.iviz.com/

You can start Java in headless mode too. There are a lot of operations
you CAN do in headless mode.
Tom Hawtin - 04 May 2007 03:40 GMT
>> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.