This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Cannot display through rsh


On Tue, 12 Aug 2003, Ben Kim wrote:

> Hi,
>
> If Cygwin is not aware of JDK, then why is it that #1
> in my example works?  Meaning, I'm able to display the
> java app when I'm on Unix and set the display to
> Windows.  Cygwin doesn't know about Java, yet the GUI
> shows up correctly in this case.
>
> Ben
>
> On Tue, 12 Aug 2003, Ben Kim wrote:
>
> > I am trying to call a script located on my Windows
> box
> > from my Unix box through rsh.  All the script does
> is
> > run a java GUI application that outputs some
> > information in standard out.  When I run this script
> > through rsh, the java process is up and running on
> > Windows (I also see output, also check task manager)
> > but the GUI frame does not show up.  On Windows, I
> > installed cygwin and xfree.  I started X via
> > xstartwin.  I also xhost + to allow any host to
> > remotely display on Windows.  I know display isn't
> the
> > problem because if I am on my Unix machine, if I set
> > the display to Windows, and run the java app locally
> > on Unix, the app correctly displays on Windows.
> Only
> > if the I'm trying to rsh the same script on Windows
> > from Unix, this doesn't work.  Another interesting
> > point is that if I were to change the script on
> > Windows to run cygwin/xfree xterm instead of the
> java
> > app,  and from Unix rsh the script, the xterm
> > correctly displays.  But as soon as I put in the
> java
> > app, it does not display.
> >
> > To summarize:
> >   1.  From Unix, run java app on Unix, display to
> > Windows (works)
> >   2.  From Unix, rsh java app on Windows, display to
> > Windows (does NOT work)
> >   3.  From Unix, rsh cygwin xapps (xterm, xclock
> etc)
> > on Windows, display to  Windows (works)
> >
> > Does anyone know what this might be the case?  And
> is
> > there any way to get #2 to work?
>
> Ben,
>
> There is no Cygwin-aware Java JDK.  This basically
> means that, unlike the
> Unix one, the JDK you're using on Windows is not using
> the X protocol to
> display windows, but rather the Windows GDI one.  In
> other words, you
> cannot do what you want without a VNC-like tool that
> would let you display
> *any* Windows native application using X.
>         Igor

Ben,

It's better to keep discussions of this sort on the list, so that other
people can offer their expertise, as well as find this discussion in the
archives should they need it later.  I have set the Reply-To field to the
appropriate list.  Please make sure your mailer honors it.

The reason you're able to see Java from Unix is that the Unix-compiled
version of Java *does* use the X protocol to display its windows.  The X
protocol was designed for easy forwarding to other machines, hence your
ability to see the windows on your local Windows box.  The Windows GDI
calls are not designed for such easy forwarding, and so you cannot forward
from a Windows machine to a Unix one.  If you got your hands on the source
of a Unix JDK and managed to build it under Cygwin, it would use the X
protocol as well, and so you'd be able to forward its windows anywhere.
Unfortunately, you wouldn't be able to distribute the resulting
application, because anything linked with cygwin1.dll automatically
becomes GPLd.  If you could find an open-source JDK, this problem would
not arise.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]