AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with Runtime.exec in Java. Buggy?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Rafael Pabst
Guest





PostPosted: Mon Nov 24, 2003 7:09 pm    Post subject: Problem with Runtime.exec in Java. Buggy? Reply with quote



Hello Folks,


I deal with the following problem.

I would like to start a DOS-Program(which needs dos4gw.exe) under Windows.
The Shell Command given down is correct: I tried it under the
Windows-Commandshell and it works fine.

Now I have following program in Java which should do quite the same:

try{Process p = Runtime.getRuntime().exec("d:\ascsrc\dos4gw.exe
d:\ascsrc\a2m204.exe d:\ascsrc\Awi_l1.asc d:\ascsrc\Awi_l1.mat");
DataInputStream ls_in = new DataInputStream(p.getInputStream());
while ((ls_str = ls_in.readLine()) != null) {
System.out.println(ls_str);
}
}catch (IOException e){e.printStackTrace();};

.... but unfortunality it appears (or happened) nothing, not even an error
like an IOException or something else. I also tried the getErrorStream
method and thought that this would produce an errorstream, but it doesn't.

Has anyone of you an idea, of what is going on here?

Many thanks in advance
Rafael


Back to top
VK
Guest





PostPosted: Mon Nov 24, 2003 9:22 pm    Post subject: Re: Problem with Runtime.exec in Java. Buggy? Reply with quote



use the most generic
.... catch (Exception e) {System.out.println(e.toString());}

My first guess is that this is SecurityException


Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.