
JavaArt Chapter 1. On-the-fly Dynamic Compilation and Execution

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains four Janino API examples:

1.  JaninoCompiler
    (consists of JaninoCompiler.java)

2.  StringExecutor
    (consists of StringExecutor.java

3.  StringBodyExecutor
    (consists of StringBodyExecutor.java)

4.  ShowMethodInfo
    (consists of ShowMethodInfo.java)


There are two Java programs included here, which can be used to
test these examples:
   Comparison.java, Painter.java
    (Note: Painter deliberately uses a deprecated method.)


There are two batch files to simplify the compilation and
execution of the example:

   compile.bat    // for compilation
     - it assumes that janino.jar is in d:\janino-2.5.8\lib\

   run.bat      // for execution
     - it assumes that janino.jar is in d:\janino-2.5.8\lib\


----------------------------
Downloading the Janino API

Janino isn't part of Java's standard distribution, and must be obtained from
http://www.janino.net/ 

I downloaded version 2.5.8 as a zipped file containing the janino.jar 
library, source code, examples, and API documentation. 

I placed the unzipped directory, janino-2.5.8/ on my d: drive.

----------------------------
Compilation:
  > compile *.java

Note: Painter deliberately uses a deprecated method.

----------------------------
Execution of the 5 examples: 

1.  JaninoCompiler
  > run JaninoCompiler <java-file>
e.g.
  > run JaninoCompiler Painter.java
  > java Painter
e.g.
  > run JaninoCompiler Comparison.java
  > java Comparison


2.  StringExecutor
  > run StringExecutor <input argument for string class>
e.g.
  > run StringExecutor andrew


3.  StringBodyExecutor
  > run StringBodyExecutor <input argument for string class>
e.g.
  > run StringBodyExecutor andrew


4.  ShowMethodInfo
  > run ShowMethodInfo  <java-file>
e.g.
  > run ShowMethodInfo Painter.java


---------
Last updated: 14th August 2007

