• Post Reply Bookmark Topic Watch Topic
  • New Topic

processes mysteriously not launched  RSS feed

 
Jim Hamrick
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why is it that certain programs (and non *.exe's) dont launch when

where pathList is an ArrayList which contains... a list of paths...

anyway, no error message pops up, the programs just dont launch, and certain progs leave processes in memory bearing their namesake, but theyre not actually doing anything. whats goin on?
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Runtime.exec is a tricky beast; it is not -- repeat, NOT -- directly analougous to C's system() command. The action that you describe could be the case for any number of reasons: The path identified is not executable by the system, you are including command-line parameters in the path (Runtime.exec really doesn't like that, in my experience...), etc.

There are a number of ways around this -- most of them are system-dependant. You could write a batch file/shell script and execute the batch file. You could use JNI write a native method the simply calls the system() command. If you poke and prod Google, I'm sure that it would tell you different ways to get around this.

That said, I can't give a much more specific answer without having a more specific example....
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure what you are trying to execute, but take a look at this article:

When Runtime.exec() won't

It gives some examples of how to get the exit code and STDOUT and STDERR output.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!