private static void bootStrap() throws InstantiationException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException {
        // print the classpath
        // String classPath = System.getProperty("java.class.path");
        // System.out.printf("JVM classpath: %s\n", classPath);
        System.setProperty("red5.deployment.type", "bootstrap");
        System.setProperty("sun.lang.ClassLoader.allowArraySyntax", "true");
        // check system property before forcing out selector
        //if (System.getProperty("logback.ContextSelector") == null) {
            // set to use our logger
            //System.setProperty("logback.ContextSelector", "org.red5.logging.LoggingContextSelector");
        //}
        String policyFile = System.getProperty("java.security.policy");
        if (policyFile == null) {
            System.setProperty("java.security.debug", "all");
            System.setProperty("java.security.policy", String.format("%s/red5.policy", System.getProperty("red5.config_root")));
        }
        // set the temp directory if we're vista or later
        String os = System.getProperty("os.name").toLowerCase();
        // String arch = System.getProperty("os.arch").toLowerCase();
        // System.out.printf("OS: %s Arch: %s\n", os, arch);
        if (os.contains("vista") || os.contains("windows 7")) {
            String dir = System.getProperty("user.home");
            // detect base drive (c:\ etc)
            if (dir.length() == 3) {
                // use default
                dir += "Users\\Default\\AppData\\Red5";
                // make sure the directory exists
                File f = new File(dir);
                if (!f.exists()) {
                    f.mkdir();
                }
                f = null;
            } else {
                dir += "\\AppData\\localLow";
            }
            System.setProperty("java.io.tmpdir", dir);
            System.out.printf("Setting temp directory to %s%n", System.getProperty("java.io.tmpdir"));
        }
        /*
         * try { // Enable the security manager SecurityManager sm = new
         * SecurityManager(); System.setSecurityManager(sm); } catch
         * (SecurityException se) {
         * System.err.println("Security manager already set"); }
         */
        // get current loader
        ClassLoader baseLoader = Thread.currentThread().getContextClassLoader();
        // build a ClassLoader
        ClassLoader loader = ClassLoaderBuilder.build();
        // set new loader as the loader for this thread
        Thread.currentThread().setContextClassLoader(loader);
        // create a new instance of this class using new classloader
        Object boot = Class.forName("org.red5.server.Launcher", true, loader).newInstance();
        Method m1 = boot.getClass().getMethod("launch", (Class[]) null);
        m1.invoke(boot, (Object[]) null);
        // not that it matters, but set it back to the original loader
        Thread.currentThread().setContextClassLoader(baseLoader);
    }