Using javac programmatically can come in handy for various purposes. I'm using it in a piece of code where a user can enter mathematical formulas. Instead of trying to interpret those, I'm wrapping them inside a
Java class, and load the class dynamically. That eventually produces native code, and is much faster than anything I could code up to interpret those formulas.