Issue1621
Created on 2010-06-16.15:15:23 by frbo, last changed 2010-06-16.16:52:14 by zyasoft.
msg5816 (view) |
Author: Frank Bos (frbo) |
Date: 2010-06-16.15:20:41 |
|
public class JythonTest
{
public static void main(String anArguments[]) throws Exception
{
jythonDirect();
jythonJSR223();
}
private static void jythonDirect()
{
PythonInterpreter myInterpreter = new PythonInterpreter();
myInterpreter.exec(
"from java.lang import String\n" +
"myString = String('Test')\n" +
"myResult = myString.substring(1,2)");
System.out.println("Direct Jython result: " +
myInterpreter.get("myResult"));
}
private static void jythonJSR223()
throws ScriptException
{
ScriptEngine myEngine = new ScriptEngineManager().
getEngineByName("jython");
if (myEngine == null)
{
throw new RuntimeException("Script engine not found!");
}
myEngine.eval(
"from java.lang import String\n" +
"myString = String('Test')\n" +
"myResult = myString.substring(1,2)");
System.out.println("JSR223 result: " + myEngine.get("myResult"));
}
}
|
msg5817 (view) |
Author: Jim Baker (zyasoft) |
Date: 2010-06-16.16:52:14 |
|
This is a support issue (JSR 223 works fine with Jython), so please use the jython-users mailing list or the #jython IRC channel. If you identify a specific bug in JSR 223, then report it here.
|
|
Date |
User |
Action |
Args |
2010-06-16 16:52:14 | zyasoft | set | status: open -> closed resolution: invalid messages:
+ msg5817 nosy:
+ zyasoft |
2010-06-16 15:20:42 | frbo | set | messages:
+ msg5816 |
2010-06-16 15:15:23 | frbo | create | |
|