wood burning stoves
The moose likes Linux / UNIX and the fly likes Runtime.exec() on Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Runtime.exec() on Linux" Watch "Runtime.exec() on Linux" New topic

Runtime.exec() on Linux

Andrew Shafer
Ranch Hand

Joined: Jan 19, 2001
Posts: 338

Let me start by saying I'm having a hell of a time and I'm beginnging to think there is some problem with the implementation of Runtime.exec(). With that being said if anyone has an idea, a clue or even just want's to babble about this, please respond.
You can see more about what I'm trying to accomplish and what I've tried here.
Anyway this is what I'm trying now.
I wrote a little shell script to that calls an executable with one argument. I just hardcoded the argument in the script to see if I could get it to work.
So I call me little shell script from a command prompt and voila, it works exactly how I would expect it to. The executable runs with the argument and I get output in the directory I called the script from. Everything is normal, predictable and good.
Now I try to execute the script with Runtime.exec() and it blows up: ERR>/usr/local/vklab/bin/Runrate: line 3: 11340 Segmentation fault (core dumped) /usr/local/vklab/rate/Rate /usr/local/vklab/rate/infiles/sct.dat
Segmentation fault, fun fun
I thought maybe I could open a shell with Runtime.exec() and then try the script with that.
Like so:

And the thing blows up again, Segementation Fault yada yada.
From a prompt, runs great, from Runtime.exec(), blows up. What to do?
Its not like I have a way to step through whatever happens once I pass it to Runtime.exec()? Do I? If no one has an idea for a solution, does anyone at least have an idea of an approach to discover the problem?

I agree. Here's the link: http://aspose.com/file-tools
subject: Runtime.exec() on Linux
It's not a secret anymore!