How do I set up jsr223 scripting with scala as scripting language

So far I have tried the sling implementation for jsr223 scripting for scala, but was not able to get it set up correctly. когда я делаю это:

public static void main(String[] args) {
    try {
        new ScriptEngineManager().getEngineByName("scala").
          eval("object HelloWorld {def main(args: Array[String]) { 
                  println(\"Hello, world!\") }}");
    } catch (ScriptException e) {
        e.printStackTrace();
    }
}

У меня ничего нет, кроме:

javax.script.ScriptException: ERROR 
org.apache.sling.scripting.scala.Script line 13 : not found: type 
Script at org.apache.sling.scripting.scala.ScalaScriptEngine.eval(ScalaScriptEngine.scala:117)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)

похожие Проблемы обсуждаются здесь: http://scala-programming-language.1934581.n4.nabble.com/How-to-compile-Scala-code-from-java-using-the-current-ClassLoader-instead-of-a-string-based-classpat-td1955873.html#a1955873

and

http://dev.day.com/discussion-groups/content/lists/sling-dev/2009-12/2009-12-01_Scala_scripting_support_was_Re_And_another_one____Michael_D_rig.html

maybe there is another Implementation that I'm not aware of.

Any help appreciated

7
задан Joris Meys 13 April 2011 в 20:04
поделиться