diff --git a/src/main/org/apache/tools/ant/launch/Launcher.java b/src/main/org/apache/tools/ant/launch/Launcher.java index cd34d448f..e0f620d58 100644 --- a/src/main/org/apache/tools/ant/launch/Launcher.java +++ b/src/main/org/apache/tools/ant/launch/Launcher.java @@ -223,9 +223,15 @@ public class Launcher { main.startAnt(newArgs, null, null); } catch (Throwable t) { if (t instanceof InstantiationException) { + t.printStackTrace(); InstantiationException ie = (InstantiationException) t; - System.err.println("Instantiation Exception - root cause:"); - ie.getCause().printStackTrace(); + if (ie.getCause() == null) { + System.err.println("Instantiation Exception - root cause: " + + ie.getCause()); + } else { + System.err.println("Instantiation Exception - root cause:"); + ie.getCause().printStackTrace(); + } } else { t.printStackTrace(); }