In this article, we will demonstrate how one can extend the business logic of a Java application, at runtime, by dynamically compiling and loading the class bytecode using the Java Compiler API.
Here is the link to the article on how one can use the Java Compiler API for dynamic code generation:
Dynamic Code Generation using Java Compiler API
Enjoy 🙂 !!!