Invokes the main method of the provided class name. @param args the command line arguments
(String className, String[] args)
| 213 | * @param args the command line arguments |
| 214 | */ |
| 215 | public static void invokeMain(String className, String[] args) { |
| 216 | try { |
| 217 | Class.forName(className) |
| 218 | .getMethod("main", new Class[] {String[].class}) |
| 219 | .invoke(null, new Object[] {args}); |
| 220 | } catch (Exception e) { |
| 221 | InternalError error = new InternalError("Failed to invoke main method"); |
| 222 | error.initCause(e); |
| 223 | throw error; |
| 224 | } |
| 225 | } |
| 226 | } |