diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java index ff8bfe68d..cf67f1160 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/tools/ajc/Main.java @@ -239,13 +239,29 @@ public void setCommand(ICommand command) { */ public void runMain(String[] args, boolean useSystemExit) { final boolean doExit = useSystemExit && !flagInArgs("-noExit", args); - + final boolean verbose = flagInArgs("-verbose", args); + + IMessageHolder holder = clientHolder; + if (null == this.clientHolder) { + this.clientHolder = checkForCustomMessageHolder(args); + } + if (null == holder) { + holder = ourHandler; + if (verbose) { + ourHandler.setInterceptor(MessagePrinter.VERBOSE); + } else { + ourHandler.ignore(IMessage.INFO); + ourHandler.setInterceptor(MessagePrinter.TERSE); + } + } // This needs to be checked, before any classes using JDT Core classes are used for the first time. Otherwise, users // will see ugly UnsupportedClassVersionError stack traces, which they might or might not interpret correctly. // Therefore, interrupt AJC usage right here, even if it means that not even a usage page can be printed. It is // better to save users from subsequent problems later. if (SourceVersion.latest().ordinal() < MINIMAL_JRE_VERSION) { System.err.println(MINIMAL_JRE_VERSION_ERROR); + IMessage minimalJreVersionErrorMessage = new Message(MINIMAL_JRE_VERSION_ERROR, null, true); + holder.handleMessage(minimalJreVersionErrorMessage); if (doExit) System.exit(-1); return; @@ -253,21 +269,7 @@ public void runMain(String[] args, boolean useSystemExit) { // Urk - default no check for AJDT, enabled here for Ant, command-line AjBuildManager.enableRuntimeVersionCheck(this); - final boolean verbose = flagInArgs("-verbose", args); final boolean timers = flagInArgs("-timers", args); - if (null == this.clientHolder) { - this.clientHolder = checkForCustomMessageHolder(args); - } - IMessageHolder holder = clientHolder; - if (null == holder) { - holder = ourHandler; - if (verbose) { - ourHandler.setInterceptor(MessagePrinter.VERBOSE); - } else { - ourHandler.ignore(IMessage.INFO); - ourHandler.setInterceptor(MessagePrinter.TERSE); - } - } // make sure we handle out of memory gracefully... try {