private static @Nullable ClassLoader getPlatformLoaderParentIfOnJdk9() {
    if (JavaVersion.current().feature >= 9) {
      // on Java 8, 'tools.jar' is on a classpath; on Java 9, its classes are available via the platform loader
      try {
        return (ClassLoader)ClassLoader.class.getMethod("getPlatformClassLoader").invoke(null);
      }
      catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return null;
  }
private static @Nullable ClassLoader getPlatformLoaderParentIfOnJdk9()