Make xooki work on java8+ based jvm.



git-svn-id: https://svn.apache.org/repos/asf/ant/site/xooki@1655225 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/antlib.xml b/antlib.xml
index b396f0f..1169aba 100644
--- a/antlib.xml
+++ b/antlib.xml
@@ -24,6 +24,11 @@
         <attribute name="checkUpToDate"/>
         <attribute name="printerFriendly"/>
         <![CDATA[
+	try {
+	    load("nashorn:mozilla_compat.js");
+	} catch (e) {
+	    // ignore the exception - perhaps we are running on Rhino!
+        }
         importClass(java.io.File);
 
         var xookidir = attributes.get("xookidir");
@@ -126,4 +131,4 @@
         }
         ]]>
     </scriptdef>
-</antlib>
\ No newline at end of file
+</antlib>
diff --git a/xooki.js b/xooki.js
index b022130..d95b515 100644
--- a/xooki.js
+++ b/xooki.js
@@ -1152,6 +1152,11 @@
 };
 
 if (batchMode) {
+        try {
+            load("nashorn:mozilla_compat.js");
+        } catch (e) {
+            // ignore the exception - perhaps we are running on Rhino!
+        }
 	importPackage(java.io);
 	
 	xooki.io.loadFile = function( url, warnOnError ) {