So I recently learned of the new JavaCompiler API available in JDK 1.6. This makes it very simple to compile a String to a .class file directly fr
Maybe you could create your own javax.tools.JavaFileManager implementing class where you would return your own implementation of javax.tools.FileObject which would then write it out to memory instead to disk. So for your subclass of javax.tools.FileObject Writer openWriter() throws IOException method you would return a java.io.StringWriter. All the methods should be converted to their String counterparts.