IO Exceptions can only be caught if the compiler predicts that there might be something in the code that throws IOException. So you are getting a warning that IO exception is never thrown from the try statement body (since there is nothing in the body of try).