(String command)
| 3 | public class Shell { |
| 4 | |
| 5 | public static void exec(String command) { |
| 6 | try { |
| 7 | int code = Runtime.getRuntime().exec(command).waitFor(); |
| 8 | if (code != 0) throw new RuntimeException("Shell command failed with exit code " + code); |
| 9 | } catch (Exception e) { |
| 10 | e.printStackTrace(); |
| 11 | } |
| 12 | } |
| 13 | } |