関数 calc.lua は次のとおりです。
function foo(n)
return n*2
end
これが私のLuaJavaCallです
L.getGlobal("foo");
L.pushJavaObject(8);
int retCode=L.pcall(1,1,0); // nResults)//L.pcall(1, 1,-2);
String errstr = L.toString(-1); // Attempt to perform arithmetic on local variable 'n'
更新: 以下に示すように、L.pushJavaObject() の代わりに L.pushNumber(8.0) を使用する必要がありました