Java displays on X11 under OS X?

By default, Java on OSX uses Quartz. I'd like to run a Java app on a Mac and set the X display to a Sun box. Is there a command line option, etc.?

Yes, I know--why not just run it on the Sun? Long set of answers--huge data set locally available on Mac, etc.

Any help would be appreciated.

PBG4 1.5GHz 15 1.25GB, iMac G5 1.6GHz 512MB, Mac Mini 1.67GHz Intel 1GB, iPod 60, Mac OS X (10.4.6)

Posted on Apr 12, 2006 4:28 PM

Reply
8 replies

Apr 13, 2006 6:24 AM in response to D7

Andy is right - if the Sun allows inbound X11 traffic (no firewall or security) - his suggestion is the easiest. It's purely an X11 thing - so as long as the java app is smart enough to use X11 - not native display for mac - you can get the X11 traffic there (xhost + or other xhost might be needed on the Sun side or ssh tunneling once you have an terminal open to the Sun (and the mac X11 tunneling turned on in ssh...)

Let us know which you choose (traditional X11 network over ports 6000 - setting DISPLAY=sun hostname.domain:0.0) or ssh tunneling and we should be able to help.

Apr 13, 2006 11:47 AM in response to Michael Bradshaw

I tried the -display option and the DISPLAY env variable approaches, but no success. The app display appeared in Quartz in either case even though setting the display to the Sun box.

Michael, you mentioned "so long as the java app is smart enough to use X11"... What does a java app need do (or not do) to use X11?

Thanks in advance.

Apr 13, 2006 1:22 PM in response to Michael Bradshaw

Java applications typically display GUIs using Swing, which is provided as part of the Java distribution itself. Apple's implementation of Swing knows how to talk to Quartz, not X11. This is to do with the Java vendor, not the vendor of the application you're using.

The Java that comes with the other platforms you refer to have a swing which knows how to talk to X11, so you can just use the normal X11 forwarding procedure to forward it to your Mac.

Apr 13, 2006 2:27 PM in response to D7

Hi D7,
I'm pretty sure that you can't do what you want with Apple's Java. Apple has worked incredibly hard to implement the Aqua version of Java but to my knowledge, haven't developed the capability of using multiple windowing systems. The only hope I see for what you're doing is to try to port the source code of a Linux Java to the Mac.

There are a number of options for addressing the problem a little differently. The simplest is VNC. VNC isn't as efficient as XWindows but it will let you run aqua applications. Other possibilities involve moving the data from the Mac to the Sun. Since that could possibly be put on a schedule and done in the background, moving it might not be as bad as it sounds initially. Of course I don't know the circumstances or what kind of data it is so I can't really say much about options. Just remember the Sun motto, "the network is the computer."
--
Gary
~~~~
Great Moments in History: #3

August 27, 1949:
A Hall of Fame opened to honor outstanding members
of the Women's Air Corp. It was a WAC's Museum.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Java displays on X11 under OS X?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.