• Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue with the exec()  RSS feed

 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks,

When i try to use the Process class to run the following command below. The jar throw the "usage". But i want the user using the code can pass the automation parameter to an properties file and not make changes to the lass file. How can i do that here?



Thanks
Aditya
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There could be all sorts of things wrong with this command line -- we have no way of knowing -- but right off the bat, I'm sure there needs to be a space inside the quotes after "-automation" and before "-serverPools".

you should have a look at the version of Runtime.exec() which lets you pass each token of the command line as a separate element in String array -- it takes care of that kind of thing for you.
 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The space after automation and before serverPools did the trick. It was my bad.

Thanks a lot, i appreciate it.

-Aditya
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginning" problem. Moving thread.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!