Java7

Try to merge the Java7 security changes.