Yes, I wanted to print the stack trace and I tried this out but it didn't print the stack trace. Here is what I tried:

The x.printStackTrace() prints it, the earlier line prints only the error message. What am I missing?

	@Test
	public void checkfile() {
		try {
			FileReader fr = new FileReader("/tmp/doesnotexist");
		} catch (IOException x) {
		    System.out.println("IOException:" + x);
		    x.printStackTrace();
		}
	}