Re: Unreachable Catch Block

Hello Kon,

That is a syntax error, and should show up as such in Idea too. It does for
me: "Exception '' is never thrown in the corresponding
try block". As far as I'm aware it shouldn't even be possible to disable
it. What build of Idea are you using? Is there anything else usual about
your project? Does it happen with a simple test project?


My employer uses Eclipse.  Whilst most warnings and errors in IntelliJ
indeed surpass that of Eclipse's in my opinion, I have yet to find an
equivalent analysis in Idea that warns/errors on the following:


public class ExceptionTest
public ExceptionTest()
try {
System.out.println("Obviously nothing to trigger the
caught exception below");
} catch (IOException e) {

In Eclipse the } catch (IOException e) { line fails as an error.

Unreachable catch block for IOException. This exception is never
thrown from the try statement body
/trunk/src/utils    line 12    Java Problem

I'd like to know how to achieve similar in Idea.  This is a roadblock
for Idea adoption at my work, since such errors in Eclipse are marked
as serious compile ones meaning my colleagues using Eclipse cannot
compile {emoticon:class=jive_macro
Any ideas?

Original message URL:

Please sign in to leave a comment.