Shutting down my system using java
1 posts in topic
Flat View  Flat View

Posted By:   Avani_Shah
Posted On:   Thursday, September 20, 2001 09:10 AM


i wanted to know how i can shutdown my windows or Linux system using java.

Re: Shutting down my system using java

Posted By:   Nathan_Meyers  
Posted On:   Friday, September 21, 2001 12:46 PM

There is no method in the JDK to do it. On Linux, this should work if the Java process is being run by root:

    Runtime.getRuntime().exec("/sbin/shutdown -h");
About | Sitemap | Contact