ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
XmlEnvironmentTemplateReader environmentTemplateReader = new XmlEnvironmentTemplateReader();
environmentTemplateReader.setClassLoader(classLoader);
environmentTemplateReader.setXmlFile(new DefaultResource(environmentTemplateFileLocation));
EnvironmentTemplate environmentTemplate = environmentTemplateReader.readObject();
PropertiesFileEnvironmentFactoryBean environmentFactory = new PropertiesFileEnvironmentFactoryBean(environmentTemplate);
environmentFactory.setEnvironmentFile(new DefaultResource(environmentFileLocation));
Environment environment = environmentFactory.createEnvironment();
interperter.setEnvironment(environment);
XmlCommandsReader commandsReader = new XmlCommandsReader();
commandsReader.setClassLoader(classLoader);
commandsReader.setXmlFile(new DefaultResource(commandsFileLocation));
CommandsTemplate groups = commandsReader.readObject();
interperter.setCommandsTemplate(groups);
return interperter;
}