public static void main ( String [ ] args ) throws Throwable { try { Class < ? > initialClass ; // make it independent - get class name & method from props/manifest initialClass = Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( "kg.apc.cmdtools.PluginsCMD" ) ; Object instance = initialClass . newInstance ( ) ; Method startup = initialClass . getMethod ( "processParams" , ( new String [ 0 ] ) . getClass ( ) ) ; Object res = startup . invoke ( instance , new Object [ ] { args } ) ; int rc = ( Integer ) res ; if ( rc != 0 ) { System . exit ( rc ) ; } } catch ( Throwable e ) { if ( e . getCause ( ) != null ) { System . err . println ( "ERROR: " + e . getCause ( ) . toString ( ) ) ; System . err . println ( "*** Problem's technical details go below ***" ) ; System . err . println ( "Home directory was detected as: " + jarDirectory ) ; throw e . getCause ( ) ; } else { System . err . println ( "Home directory was detected as: " + jarDirectory ) ; throw e ; } } }
The main program which actually runs JMeter .