Add version matching code for JDK 9