In my current project, I need to compile java code at runtime (in the background to process input from the user). This works fine with tools.jar in the classpath. However, not all users of my program have JDK installed on their system. Some of them only have JRE and in that case there is no java compiler available at runtime. I can solve that problem by including tools.jar from Sun as a part of my tool.
But tools.jar is very big (>12 MB). The problem is that I have to include the large jar file, although I am interested only in a small fraction of the functionality provided by this jar.
Is it possible to break up the tools.jar file so that I have a small subset of classes that are required for compiling java code only?
Is this illegal?
Thanks a lot.