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

@@ -14,7 +14,6 @@
<h1>
<a href="README.html"><img src="http://sourceforge.net/dbimage.php?id=196139" alt="" border="0"></a>
Add Multimedia Data
Getting Started with LuaJ
</h1>
@@ -76,8 +75,9 @@ The following pattern is used within J2SE
import org.luaj.vm.*;
String script = "main.lua";
Platform.setPlatform( new J2sePlatform() );
Platform.setInstance( new J2sePlatform() );
LuaState vm = Platform.newLuaState();
org.luaj.compiler.LuaC.install();
vm.getglobal( "dofile" );
vm.pushstring( script );
vm.call( 1, 0 );
@@ -86,6 +86,12 @@ The following pattern is used within J2SE
<p>
You must include the library <b>lib/luaj-j2se-${VER}.jar</b> in your class path.
<p>
A working example may be found in
<pre>
src/sample/SampleJ2seMain.java
</pre>
<p>
Additional usage may be found in
<pre>
@@ -102,8 +108,9 @@ The following pattern is used within MIDlets:
import org.luaj.vm.*;
String script = "main.lua";
Platform.setPlatform( new J2mePlatform() );
Platform.setInstance( new J2meMidp20Cldc11Platform( midlet ) );
LuaState vm = Platform.newLuaState();
org.luaj.compiler.LuaC.install();
vm.getglobal( "dofile" );
vm.pushstring( script );
vm.call( 1, 0 );
@@ -128,6 +135,9 @@ but before the script is executed:
org.luaj.compiler.LuaC.install();
</pre>
<p>
To omit the compiler, omit this line from your startup code.
<h2>Run a script using JSR-233 Dynamic Scripting</h2>
<p>