improved JDK detection