title: How can I compile and deploy a java class at runtime?
body: <p>I am in the process of writing a rule engine that performs simple assignments as determined by conditional constructs. It is a prerequisite of the project that the rules be in XML format. I have modeled my XML schema to resemble simple code blocks. I wish to parse the XML and to then transform it into Java code. I then wish to compile (and run) this code at runtime. Doing so would mean that my rule engine no longer acts as an interpreter but executes native Java Byte Code.</p>
  
  <p>I have figured out the parsing stage and more or less the Java code generation phase. I would now like to figure out the last phase - the compile at runtime phase.</p>
  
  <p>Following this thread: <a href="https://stackoverflow.com/questions/688098/compile-to-java-bytecode-without-using-java">Compile to java bytecode (without using Java)</a> I have become aware of the following possible solutions:</p>
  
  <ul>
  <li><a href="http://asm.objectweb.org/" rel="nofollow noreferrer">ASM</a></li>
  <li><a href="http://jakarta.apache.org/bcel/" rel="nofollow noreferrer">BCEL</a></li>
  <li><a href="http://teatrove.sourceforge.net/trove.html" rel="nofollow noreferrer">Trove</a></li>
  </ul>
  
  <p>I would love a comparison of these as well as other suggestions for solving the Java compile at runtime phase.</p>