Inline compile into class, then execute.

Hi,

I am sure this question has been asked before but I can't seem to find where.

I would like to compile a class in memory then run the generated class file. Somthing like Class klass = Compiler.compile("class MyClass {public void run() {}}"), then run the run method from the class. I did see some years back somthing like this, but was it with the Sun compiler which has since been deprecated?

Thanks in advance.

Mike

[452 byte] By [MichaelCoucka] at [2007-10-3 0:34:52]
# 1
it may help you: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Compiler.htmlmethod Compiler.compile(Class c) doesn't exist !
suparenoa at 2007-7-14 17:28:35 > top of Java-index,Developer Tools,Java Compiler...