title: Java 8 Javascript Engine backwards compatibility
body: <p>I am trying out Java 8 in my project and I am stuck in an error related to my build process.</p>
  
  <p>I am using ANT scripts and at some point i am using some javascript (embeded into ANT) to do some build specific operations. The part of the script that is causing the error looks like below:</p>
  
  <pre><code>&lt;script language="javascript"&gt; 
  
          &lt;![CDATA[
  
          importClass(java.io.File);
          importClass(java.io.FileReader);
                      ...
                      ]]&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>The project is building fine with Java 7 or Java 6, but it gives me some errors when i am using Java 8. These errors are related to the upgrade of the JS engine.</p>
  
  <p>In particular i am getting the following exception:</p>
  
  <p>javax.script.ScriptException: ReferenceError: "importClass" is not defined in  at line</p>
  
  <p>After some googling i found out that it is related to the below issue in the JDK</p>
  
  <p><a href="https://bugs.openjdk.java.net/browse/JDK-8025132" rel="noreferrer">[#JDK-8025132]</a></p>
  
  <p>I tried what is suggested in the comments but without luck. </p>
  
  <p>How can I make Java 8 Nashorn engine to be compatible with the Rhino JS engine?</p>