title: Java compiler at Runtime
body: <p>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. </p>
  
  <p>But tools.jar is very big (>12 MB). <em>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.</em></p>
  
  <ol>
  <li><p>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? </p></li>
  <li><p>Is this illegal?</p></li>
  </ol>
  
  <p>Thanks a lot.</p>