Added Java version detection in configure, and now check if version is compatible in Java codes.