Create a Java file runtime and Execute to get result

Advertisement
Hi,
Is this possible to generate a Java Class run time and execute it to get result..if yes how...any example or site reference..
Thanks
Advertisement

Replay

Yes: http://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htm
It would be better if you tell us what the problem is that you want to solve.
The above may not be optimal, as it requires you provide your users with a part of the JDK (not JRE!): tools.jar, placed correctly in a jre directory, if I remember well.