[EMAIL PROTECTED] wrote:
> 
> > Dimitris Terzis wrote:
> >
> > Hi guys...
> >
> > I am trying to launch an external application from my Java program,
> > using exec().
> >
> > I do Runtime.getCurrentRuntime() and then try to exec() the
> > application (not internal command), providing a properly created path.
> > My application has a GUI which is never displayed. However, if I type
> > "ps -aux" I can see that the process is there, which is reasonable
> > since, in all cases, the Process object returned from
> > Runtime.getCurrentRuntime().exec(...) is valid and no IOException (or
> > whatever other error) occurs.
> >
> > I am running JDK 1.2.2-RC2 from Sun, on a RedHat 6.1 box.
> 
> There's nothing obviously wrong with the system. I'm running the same
> JDK under RH6.1 and this trivial example works:
> 
> > public class Temp
> > {
> >     public static void main(String[] argv)
> >       throws java.io.IOException
> >     {
> >       Runtime.getRuntime().exec("xclock");
> >     }
> > }

If you are using wildcards then you need to invoke the shell
and get it run the command on your behalf

> > public class Temp
> > {
> >     public static void main(String[] argv)
> >       throws java.io.IOException
> >     {
                String command = "ls *.java";
                String cli[] = { "/bin/sh", "-c", command };
> >       Runtime.getRuntime().exec( cli );
> >     }
> > }


-- 

Adios
Peter

-----------------------------------------------------------------
import std.Disclaimer;          // More Java for your Lava, Mate.
T H E    R E D   A R M Y        ! ! !   http://www.manutd.com/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to