Home arrow static arrow Java Programming [Archive] - Trouble with executing files
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Trouble with executing files
This topic has 4 replies on 1 page.

Posts:2
Registered: 7/30/04
Trouble with executing files  
Jul 30, 2004 12:09 PM



 
I am writing a program that creates a Java interface, and uses that to run a scientific calculating Fortran program, I called "css.exe". When I run the command:

Process proc = Runtime.getRuntime().exec("css.exe")

it will only run part of the program, nor will it close itself on its own, because it is not finishing. If I do

Runtime.getRuntime().exit(0)

or anything like that, it will not do anything either. If I instead execute

proc.destroy()

Then it will kill my program, and even if I wait for an excessive amount of time, it will not finish the program.
Finally, when I use the waitFor() command, then it just continues to wait, and makes no more progress in the program than due to any other command, and then my java program stops as well. Any help on how to change the allocation of memory to my program, or guarantee that the entire program can be run, I would greatly appreciate it. I have never programmed in Java before, so I really don't know what I'm doing.
 

Posts:21,718
Registered: 98-02-20
Re: Trouble with executing files  
Jul 30, 2004 12:11 PM (reply 1 of 4)



 
Read this carefully:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

%
 

Posts:2
Registered: 7/30/04
Re: Trouble with executing files  
Jul 30, 2004 12:26 PM (reply 2 of 4)



 
That tutorial does explain that I'm having problems and that I should be able to fix them. However, I do not know anything about Java, since I have never used it before, and have just essentially been guessing commands and using free online code to make my makeshift program. So, do you think that you could perhaps help explain what I would need to change...because, there are no parameters or anything besides my program name that I should need to include in such a function call, since it is only one line of code that I am having trouble executing.
 

Posts:2,206
Registered: 8/15/02
Re: Trouble with executing files  
Jul 30, 2004 12:31 PM (reply 3 of 4)



 
That link has lots of example code. What else do you need?
 

Posts:21,718
Registered: 98-02-20
Re: Trouble with executing files  
Jul 30, 2004 12:38 PM (reply 4 of 4)



 
That tutorial does explain that I'm having problems
and that I should be able to fix them.

However, I do not know anything about Java, since I have never used it before,

Then how do you expect to complete this task?

and have just essentially been guessing
commands and using free online code to make my
makeshift program.

Wow. Is this a school or work assignment?

So, do you think that you could
perhaps help explain what I would need to
change...because, there are no parameters or anything
besides my program name that I should need to include
in such a function call, since it is only one line of
code that I am having trouble executing.

The last example in the article should be enough, really. It works properly. Once you have that going it should be an easy matter to see where you can substitute the one command example they use for a general one you can input on the command line.

Good luck.

%
 
This topic has 4 replies on 1 page.