code: public static void main(String[] args) {
      Version version = HBaseVersion.get();
      System.out.println(version.getMajorVersion());
    }
docs: Prints out the HBase {@link Version} enum value for the current version of HBase on the classpath.