You can compile a class at run-time by just running "javac" via Runtime.exec(). I believe there is also a direct interface to the Java compiler. That would be more efficient and possibly more flexible, but I have not used it so I cannot give details; search Sun's documentation.
If your compilation generates a class file in a directory that is already on the class path, then you can easily load the class (e.g. with Class.forName()). Alternatively, with a custom ClassLoader of your own, you can load it from wherever it is.
Don't put "it's urgent" in your posts. This is likely to reduce, rather than increase, the number and quality of replies. EaseUp.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
It's possible to drive the Java compiler from within Java code, either through a Sun-internal API (for JDKs before Java 6), or in Java 6 through the new official API. Articles that describe both methods are linked in the JavaIntermediateFaq. [ June 29, 2007: Message edited by: Ulf Dittmer ]
I child proofed my house but they still get in. Distract them with this tiny ad: