//when starting via main set the look and feel to system
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
final Console console = new Console(Console.class.getClassLoader());
console.setBeforeExecution(new Closure(null) {
public void doCall() {
console.setShell(new GroovyShell(Console.class.getClassLoader(), new Binding()) {
public Object run(String scriptText, String fileName, String[] args) throws org.codehaus.groovy.control.CompilationFailedException {
return super.run(IMPORTS + scriptText, fileName, args);
};