Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ProcessBuilder gives error on command that runs successfully on command prompt  RSS feed

 
Pooja Gupta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to programatically kill Tomcat7.exe service. The command runs successfully when run directly from Command Prompt (when run as an Administrator), but gives error when I try to program it using ProcessBuilder.

The command I amd trying to run is : Taskkill /F /IM tomcat7.exe

The code I am using is:

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but gives error when I try to program it using ProcessBuilder.

Please post the whole error stack trace
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!