This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes Executing Unix command from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Executing Unix command from java" Watch "Executing Unix command from java" New topic
Author

Executing Unix command from java

Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
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?


$Hi/\bEr
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44530
    
  34
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Executing Unix command from java
 
It's not a secret anymore!