Few JDK9 related & general changes

Changes apply to older JDKs as well.
Shouldn't we fail below if permgen != null || maxPermGen != null?