fix build: openjdk 7 requires changes to javac cflags and some code tweaks. patch sourced from http://comments.gmane.org/gmane.os.illumos.devel/11285