docs: public static ShellConsole getConsole(Scriptable scope, Charset cs) {
          // We don't want a compile-time dependency on the JLine jar, so use
          // reflection to load and reference the JLine classes.
          ClassLoader classLoader = ShellConsole.class.getClassLoader();
          if (classLoader == null) {
              // If the attempt to get a class specific class loader above failed
              // then fallback to the system class loader.
              classLoader = ClassLoader.getSystemClassLoader();
          }
          if (classLoader == null) {
              // If for some reason we still don't have a handle to a class
              // loader then give up (avoid a NullPointerException).
              return null;
          }
          try {
              // first try to load JLine v2...
              Class<?> readerClass = Kit.classOrNull(classLoader,
                      "jline.console.ConsoleReader");
              if (readerClass != null) {
                  return getJLineShellConsoleV2(classLoader, readerClass, scope, cs);
              }
              // ...if that fails, try to load JLine v1
              readerClass = Kit.classOrNull(classLoader, "jline.ConsoleReader");
              if (readerClass != null) {
                  return getJLineShellConsoleV1(classLoader, readerClass, scope, cs);
              }
          } catch (NoSuchMethodException e) {
          } catch (IllegalAccessException e) {
          } catch (InstantiationException e) {
          } catch (InvocationTargetException e) {
          }
          return null;
      }