Java ScriptEngineManager no longer works with Mountain Lion's AppleScript

Viewed 3268

Ever since I upgraded to Mountain Lion, I can't run my AppleScript code through the Java ScriptEngineManager.

The sample code found on Apple's page (link) returns null for the engine object.

public static void main(String[] args) throws Throwable {
    String script = "say \"Hello from Java\"";

    ScriptEngineManager mgr = new ScriptEngineManager();
    ScriptEngine engine = mgr.getEngineByName("AppleScript");
    engine.eval(script);
}

Anybody know of any workarounds?

5 Answers
Related