public static String getJRubyVersion(final ClassLoader classLoader) {
        final Class<?> class_Constants;
        try {
            class_Constants = classLoader.loadClass("org.jruby.runtime.Constants");
        } catch (ClassNotFoundException ex) {
            // `org.jruby.runtime.Constants` is not implemented in the JRuby version -- unlikely.
            return null;
        }
        return (String) getStaticField_Constants(class_Constants, "VERSION");
    }
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