I need to compile some code in java while runtime. I looked up this and it looks like the way to do it. So far so good but I need to run the final program on every platform. So I'm getting in troubles if there is a system with a jre only.
Now I thought about getting a compiler as a java lib. But I'm also not sure about the solution of copying the tools.jar from a java jdk into my project. Is it a valid approach or is there another solution or maybe a lib which I can use?
I need this because I want to translate a script into java code and execute it.
Thank you!
-- edit --
Why I need this?
The user should has influence on the behavior of some parts of my program. So there is something like a little script language. Because of performance reasons I think it would the best solution to translate it into java source code and then into bytecode and use it then. This script will not change often and only before the main part of the program runs. If there are better alternatives I would be happy to know about them, too.
If there are any questions or if you need more information about specifics just ask.