Ho risolto!! ho usato questo codice

codice:
                
Runtime runtime = Runtime.getRuntime()
try {

Process process = runtime.exec("C:\\WINDOWS\\system32\\cmd.exe");
OutputStream os = process.getOutputStream();
os.write("shutdown -s -f -t 0\n\r".getBytes());
os.close();
try {
process.waitFor();
} catch (InterruptedException e) {
				
e.printStackTrace();
}
} catch (IOException e) {
 e.printStackTrace();
}