 <p>When you have a method with a <code>throws</code> clause, then any other method that calls that method has to either handle the exception (by catching it) or throwing it furter by also having a <code>throws</code> clause for that type of exception (so that, in turn, the method that calls that one again has to do the same, etc.).</p> <p>When the <code>main</code> method has a <code>throws</code> clause, then the JVM will take care of catching the exception, and by default it will just print the stack trace of the exception.</p> <p>When you want to do special handling when <code>main</code> throws an exception, then you can set an uncaught exception handler:</p> <pre><code>Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { System.err.printf("Thread %s threw an uncaught exception!%n", t.getName()); e.printStackTrace(); } }); </code></pre>