 <p>You would have to some how invoke a compiler (such as Suns javac), parse its output in case of errors and load the resulting classes dynamically.</p> <p>There is no API-classes in the Java runtime library that will parse, compile and run Java source code.</p>