I am using Java script engine to run javascript at run time and I have a java method like so
public void func(Object x, Object... args)
{//CODE..}
And I am trying to call that method via the script engine
classX myClass = new classX();
scriptEngine.bind("myClass", myClass);
scriptEngine.eval("myClass.func(1, 2,3,4,5)");
But the method wont run. all I get is null, no error.
try using put instead of bind...its work for me scriptEngine.put("myClass", myClass);