Class[] argTypes = new Class[] { String[].class };
Method main = mainClass.getMethod("main", argTypes);
//String[] mainArgs = Arrays.copyOfRange(parameters, 1, parameters.length);
main.invoke(null, (Object)parameters);
} catch (IllegalAccessException ex) {
throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
} catch (IllegalArgumentException ex) {
throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
} catch (InvocationTargetException ex) {
throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
} catch (NoSuchMethodException ex) {
throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
} catch (SecurityException ex) {
throw new JemmyException("Unable to execute " + mainClass.getName(), ex);
}
}
});
}