diff --git a/build.xml b/build.xml
index e98f99fe..bd82b618 100644
--- a/build.xml
+++ b/build.xml
@@ -53,46 +53,50 @@
-
-
+
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
-
+
-
-
+
-
+
-
+
+
+
+
+
+
+
+
+
@@ -106,10 +110,6 @@
-
-
-
-
diff --git a/lib/js-engine.jar b/lib/js-engine.jar
new file mode 100644
index 00000000..7b0db58d
Binary files /dev/null and b/lib/js-engine.jar differ
diff --git a/lib/js.jar b/lib/js.jar
new file mode 100644
index 00000000..2369f99a
Binary files /dev/null and b/lib/js.jar differ
diff --git a/source/net/sourceforge/filebot/format/AssociativeScriptObject.java b/source/net/sourceforge/filebot/format/AssociativeScriptObject.java
index 8292a6ce..9aa9b8c7 100644
--- a/source/net/sourceforge/filebot/format/AssociativeScriptObject.java
+++ b/source/net/sourceforge/filebot/format/AssociativeScriptObject.java
@@ -6,7 +6,7 @@ import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
-import sun.org.mozilla.javascript.internal.Scriptable;
+import org.mozilla.javascript.Scriptable;
class AssociativeScriptObject implements Scriptable {
diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.java b/source/net/sourceforge/filebot/format/ExpressionFormat.java
index f2a62d4d..22b233dc 100644
--- a/source/net/sourceforge/filebot/format/ExpressionFormat.java
+++ b/source/net/sourceforge/filebot/format/ExpressionFormat.java
@@ -16,10 +16,11 @@ import javax.script.Compilable;
import javax.script.CompiledScript;
import javax.script.ScriptContext;
import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import javax.script.SimpleScriptContext;
+import com.sun.phobos.script.javascript.RhinoScriptEngine;
+
public class ExpressionFormat extends Format {
@@ -37,7 +38,8 @@ public class ExpressionFormat extends Format {
protected ScriptEngine initScriptEngine() throws ScriptException {
- ScriptEngine engine = new ScriptEngineManager().getEngineByName("JavaScript");
+ // don't use jdk rhino so we can use rhino specific features and classes (e.g. Scriptable)
+ ScriptEngine engine = new RhinoScriptEngine();
engine.eval(new InputStreamReader(ExpressionFormat.class.getResourceAsStream("ExpressionFormat.global.js")));