code: public static String getImplementationVersion(Class<?> clazz) {
          /*
           * We don't use Package.getImplementationVersion() due to
           * a duplicate package would override the origin package info.
           * https://stackoverflow.com/questions/1272648/reading-my-own-jars-manifest
           */
          String className = clazz.getSimpleName() + ".class";
          String classPath = clazz.getResource(className).toString();
          if (!classPath.startsWith("jar:file:")) {
            // Class not from JAR
            return null;
          }
          // Get manifest
          int offset = classPath.lastIndexOf("!");
          assert offset > 0;
          String manifestPath = classPath.substring(0, offset + 1) +
                                "/META-INF/MANIFEST.MF";
          Manifest manifest = null;
          try {
              manifest = new Manifest(new URL(manifestPath).openStream());
          } catch (IOException ignored) {
              return null;
          }
          return manifest.getMainAttributes()
                         .getValue(Attributes.Name.IMPLEMENTATION_VERSION);
      }
docs: Get implementation version from manifest in jar
  @param clazz The class to be load from jar package
  @return      The implementation version