// This is expected to fail. try { System.out.println(System.getProperty("user.home")); } catch (SecurityException e) { e.printStackTrace(System.err); } AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { // This should work. System.out.println(System.getProperty("user.home")); return null; } });