private static Field createField_Options(final ClassLoader classLoader, final String fieldName) {
        final Class<?> clazz;
        try {
            clazz = classLoader.loadClass("org.jruby.util.cli.Options");
        } catch (ClassNotFoundException ex) {
            return null;  // TODO: Log.
        }

        try {
            return clazz.getField(fieldName);
        } catch (NoSuchFieldException ex) {
            return null;  // TODO: Log.
        }
    }
Indirects onto JRuby not to require JRuby classes directly.

It calls methods of ScriptingContainer through reflection.

This trick enables Embulk:

<ul>
<li>To load a JRuby runtime (jruby-complete-*.jar) specified at runtime out of embulk-*.jar.
<li>To switch versions of JRuby without releasing or repackaging.
<li>To distribute Embulk without JRuby runtimes embedded.
</ul>
embulk-core/src/main/java/org/embulk/jruby/ScriptingContainerDelegateImpl.java