How to set the root cause when throwing an exception

NamingException ne = new NamingException("foo bar blah blah");
ne.setRootCause(e);
throw ne;