Java tutorial
//package com.java2s; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { public static void reboot() { try { Process su = Runtime.getRuntime().exec("su"); OutputStreamWriter out = new OutputStreamWriter(su.getOutputStream()); out.write("reboot"); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } } }