if i were smart, i would try out your source code example before sending a 
response to the list.  but laziness wins again, so...

you might try adding '.' to your path.  i've had some problems before with exec()
and relative paths--in a unix shell, './a.out' will work even if '.' isn't in your 
path, but the same doesn't seem to be true with java's exec().  i don't know if 
this is a by design or a bug in the jdk.  again, if i were smart, i'd look it up.

good luck.

-allen

On Fri, Mar 17, 2000, 12:55, [EMAIL PROTECTED] wrote
!Hi:
! 
!Thank you very much for everyone responding to my original question.  I did
!try to use exec("./a.out") in the java application but still get exception
!like:
! 
!/mnt/e/Linux/java/proc/One>java communicate 
!got e after try exec()
!java.io.IOException: ./a.out: not found
! at java.lang.Runtime.exec(Runtime.java)
! at java.lang.Runtime.exec(Runtime.java)
! at communicate.main(communicate.java:14)
!/mnt/e/Linux/java/proc/One>
! 
!a.out is in the same directory as the java application.  No problem to run
!a.out as a standalone app from the command line.  It's only a hello world
!app.  I attached the java app source code below.  Could someone take a look
!and see what I did wrong?  I'm using BlakDown 1.1.8 v1 on RH 6.1
! 
!Thank you.
! 
! 
!Lee
! 
!/*******************************************************
!* java application source code
!********************************************************/
!import java.lang.*;
!import java.io.*;
! 
!class communicate
!{    
!    Process proc_; 
!    
!    public static void main(String argv[])
!    {
!        communicate app = new communicate();
! 
!        try
!        {
!           app.proc_ = Runtime.getRuntime().exec("./a.out");
!        }
!        catch(IOException e)
!        {
!            System.out.println("got e after try exec()");
!           e.printStackTrace();
!        }
!    }
!}
!    
!
! 
!
!-----Original Message-----
!From: Xing, Lee 
!Sent: Thursday, March 16, 2000 4:40 PM
!To: [EMAIL PROTECTED]
!Subject: exec() on Linux
!
!
!Hi:
! 
!I got a java application that uses exec("nativeApp.exe") to start a native
!application.  It works fine on NT.  But on Linux exec("a.out") gets an
!exception saying a.out could not be found.  a.out is placed in the same
!directory as java app does.  What I missed?
! 
!Thank you.
! 
! 
!Lee
! 
!
!


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

Reply via email to