title: Calling java class methods in Rhino script
body: <p>I have one interface method as follows and saved in Order.java file
  and rhino script.</p>
  
  <p>In rhino script I am trying to call the interface methods. </p>
  
  <p><strong>rhino:</strong>   </p>
  
  <pre><code>var x = Packages.com.data.Order.X;
  print(x);
  </code></pre>
  
  <p><strong>java:</strong></p>
  
  <pre><code>package com.data;
  
  public interface Order 
  {
      String X = "Hello, World!";
      void invoke();
  }
  </code></pre>
  
  <p>but it is not printing "Hello world".</p>
  
  <p>Instead it is printing</p>
  
  <blockquote>
    <p>uncaught JavaScript runtime exception: TypeError: Cannot call
    property invoke in object [JavaPackage com.data.Order]. It is not a
    function, it is "object". "</p>
  </blockquote>
  
  <p><strong>problem Statement: How to call java interface method from rhino script.</strong></p>