• Post Reply Bookmark Topic Watch Topic
  • New Topic

Runtime.exec() on Linux  RSS feed

Andrew Shafer
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!