title: How to use Nashorn engine to call Java Objects
body: <p>I want to use Nashorn console as alternative to Rails c. For example I would like to call Java methods to import data from remote system and to execute data migrations. I found this very intresting:</p>
  
  <p><a href="https://www.baeldung.com/java-nashorn" rel="noreferrer">https://www.baeldung.com/java-nashorn</a></p>
  
  <pre><code>$JAVA_HOME/bin/jjs
  jjs&gt; print("test"); 
  test
  jjs&gt; 
  </code></pre>
  
  <p>How I can for example call some Java method from WAR package deployed on Wildfly server and pass some arguments?</p>
  
  <p>Is there any better alternative that you can propose?</p>