This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Executing Unix command from java

 
Shiaber Shaam
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to execute an unix command using

Process p = Runtime.getRuntime().exec("");

Before executing it, how do i define the credentials and the hostnames?
 
Campbell Ritchie
Sheriff
Pie
Posts: 49445
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. How do you identify the credentials when you run it from the command line? Don't go anywhere near Runtime.exec() until you have read Michael Daconta's classic article when Runtime.exec() won't.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic