public void invokeMain(String sClass,String[] args) throws Throwable {
  Class<?> clazz=loadClass(sClass);
  logInfo(LogArea.CONFIG,"Launch: %s.main(); Loader: %s",sClass,clazz.getClassLoader());
  Method method=clazz.getMethod("main",new Class<?>[]{String[].class});
  boolean bValidModifiers=false;
  boolean bValidVoid=false;
  if (method != null) {
    method.setAccessible(true);
    int nModifiers=method.getModifiers();
    bValidModifiers=Modifier.isPublic(nModifiers) && Modifier.isStatic(nModifiers);
    Class<?> clazzRet=method.getReturnType();
    bValidVoid=(clazzRet == void.class);
  }
  if (method == null || !bValidModifiers || !bValidVoid) {
    throw new NoSuchMethodException("The main() method in class \"" + sClass + "\" not found.");
  }
  try {
    method.invoke(null,(Object)args);
  }
 catch (  InvocationTargetException e) {
    throw e.getTargetException();
  }
}

public void invokeMain ( String sClass , String [ ] args ) throws Throwable { Class < ? > clazz = loadClass ( sClass ) ; logInfo ( LogArea . CONFIG , "Launch: %s.main(); Loader: %s" , sClass , clazz . getClassLoader ( ) ) ; Method method = clazz . getMethod ( "main" , new Class < ? > [ ] { String [ ] . class } ) ; boolean bValidModifiers = false ; boolean bValidVoid = false ; if ( method != null ) { method . setAccessible ( true ) ; int nModifiers = method . getModifiers ( ) ; bValidModifiers = Modifier . isPublic ( nModifiers ) && Modifier . isStatic ( nModifiers ) ; Class < ? > clazzRet = method . getReturnType ( ) ; bValidVoid = ( clazzRet == void . class ) ; } if ( method == null || ! bValidModifiers || ! bValidVoid ) { throw new NoSuchMethodException ( "The main() method in class \"" + sClass + "\" not found." ) ; } try { method . invoke ( null , ( Object ) args ) ; } catch ( InvocationTargetException e ) { throw e . getTargetException ( ) ; } }
invokes main ( ) method on class with provided parameters .
