ClassLoader cl = Main.class.getClassLoader();
//This is a workaround for windows machines struggling with long class paths.
loadJarsFromPath(new File(System.getProperty(KARAF_HOME), "system"));
loadJarsFromPath(new File(System.getProperty(KARAF_HOME), "deploy"));
CommandProcessorImpl commandProcessor = new CommandProcessorImpl(threadio);
discoverCommands(commandProcessor, cl);
InputStream in = unwrap(System.in);
PrintStream out = wrap(unwrap(System.out));