When running ant, prefer Main class over Launcher because IDEA builds all the necessary classpath on its own. Otherwise, with Launcher,  weird problems possible because of screwed up class-loading (IDEA-105828 Ant javac fails with org.apache.tools.ant.taskdefs.Javac was not found with JAXB 2.2.7, works outside of IDEA)