Add sample startup code for j2se

This commit is contained in:
James Roseborough
2008-12-03 06:07:29 +00:00
parent 485c95bc80
commit b639a3ca3e
2 changed files with 29 additions and 3 deletions

View File

@@ -0,0 +1,16 @@
package org.luaj.sample;
import org.luaj.platform.*;
import org.luaj.vm.*;
public class SampleJ2seMain {
public static void main(String[] args) {
String script = (args.length>0? args[0]: "src/test/res/swingapp.lua");
Platform.setInstance( new J2sePlatform() );
LuaState vm = Platform.newLuaState();
org.luaj.compiler.LuaC.install();
vm.getglobal( "dofile" );
vm.pushstring( script );
vm.call( 1, 0 );
}
}