Hi All,
I am using Ubuntu machine with JDK 6. I am running following command on shell-
sudo ./somecript
. Now, it prompts for sudo password and I provide the sudo password on shell and "somescript" starts running with sudo permissions.
What I want to do is, I need to execute "sudo ./somescript" fromJava code. For that I have created a jar file which executes following command
view plaincopy to clipboardprint?
Runtime.getRuntime.exec("sudo ./somescript");
now, the problem is I dont get any prompt where I can provide the sudo password.
Please guide me to provide password to sudo.
-akash