adapted preferences for java 7