title: Generating a 'Hello, World!' class with the Java ASM library
body: <p>I have started messing around with the ASM API for a compiler project I am working on. However, I am finding that the documentation is less than clear for a newcomer in many places and I thought having a good solid example of generating a class that simply prints "Hello, World!" would be a great example to have on here.</p>
  
  <p>Currently, I can generate a class with a main() (using the ClassWriter, ClassVisitor and MethodVisitor classes) but I can't seem to work out how to generate main's body. Could anyone give me an example of generating a class file in ASM that:</p>
  
  <ul>
  <li>contains a main()</li>
  <li>creates a local String variable in main() with the value "Hello, World!"</li>
  <li>prints the variable</li>
  </ul>