I am developing a Java application under Linux.  I want it to be runnable under
Windows, but I know nothing of Windows or Windows programming.  So I am asking
for some advice on how to get around a Unix dependency in my code.

Right now, the application includes the following Unix dependent code:

   String[] strings= new String[]
   { 
     "/bin/sh",
     "-c",
     "exec java SocketFilter - </dev/tty >/dev/tty 2>/dev/tty" 
     };
     proc = Runtime.getRuntime().exec(strings);


Going through /bin/sh achieved the following for me:

  The Unix shell takes care of the PATH env variable for me. (Java Runtime's
  exec method does not.)

  The redirection to and from /dev/tty. (I am told that the various varieties of
  Windows include some kind of a console tty simulation.).

  The exec on the third lines of strings, keeps an extra process from being
  spawned so that Java Runtime's Process destroy method will kill the extra
  auxiliary Java program I launched.

I had to launch a separate Java application because an attempt to read from
System.in, hangs ALL threads.

So, my question is how can I do this so that it will work under Windows?

  Steve Bankes

  
 

Reply via email to