title: Calling a Groovy function from Java
body: <p>How do you call a function defined in a Groovy script file from Java?</p>
  
  <p>Example groovy script:</p>
  
  <pre><code>def hello_world() {
     println "Hello, world!"
  }
  </code></pre>
  
  <p>I've looked at the GroovyShell, GroovyClassLoader, and GroovyScriptEngine.</p>