Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to restart computer using simple java program

843793Apr 17 2007
i have a code for shut down how is restart and hibernate can be done
code is

import java.util.*;
import java.io.*;

public class BadExecJavac
{
public static void main(String args[])
{
try
{
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("shutdown -t 10");
}catch (Exception e)
{
System.out.print(e);
}
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 15 2007
Added on Apr 17 2007
0 comments
230 views