• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Runtime.exec() on Linux

 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
http://www.javaranch.com/ubb/Forum34/HTML/001360.html
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?
regards,
Andrew
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic