1 package org.lsst.ccs.utilities.main;
2
3 import java.lang.reflect.Method;
4
5 public class AltMain {
6 public static void main(String[] args) throws Throwable {
7 ClassLoader loader = AltMain.class.getClassLoader();
8
9
10 String mainClass = System.getProperty("MainClass");
11 if (mainClass != null)
12 {
13 Class main = loader.loadClass(mainClass);
14 Method mainMethod = main.getMethod("main", String[].class);
15 mainMethod.invoke(null,(Object) args);
16 }
17 else
18 {
19 System.out.println("This is just a wrapper Main. In order to run it you have to specify the \"MainClass\" system property to point the actual class you would like to run.");
20 }
21 }
22 }