title: How to compile .java file from within java program
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/10889186/compiling-external-java-files-from-within-java">Compiling external .java files from within Java</a>  </p>
  </blockquote>
  
  
  
  <p>I have been using examples from all over the net but I keep getting NullPointerExceptions when invoking the run method in JavaCompiler. If you know how to compile another java file from within a java file please provide code on how to do this. Thanks</p>