1
所以我得到了加載.lua文件的這個java文件。如果我嘗試在Eclipse中運行它,它非常基本並且工作正常。LuaJ(Java)編譯爲jar
現在,當我在可運行jar文件中編譯項目時,它根本不會加載。當你雙擊它時,它只是加載和停止。
我嘗試了多個jar編譯選項,但它似乎並沒有工作。
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.JsePlatform;
public class SampleJseMain {
public static void main(String[] args) throws Exception {
String script = "main.lua";
// create an environment to run in
LuaValue _G = JsePlatform.standardGlobals();
_G.get("dofile").call(LuaValue.valueOf(script));
}
}
而且Lua的主要文件:
delay = 100000
while delay > 1 do
print('hello, world')
delay = delay - 1
end
-1爲什麼你接受一個要求提供更多信息的答案,但是不要給我們更多的信息,或者你是如何運作的? – nonchip 2013-11-21 10:12:30