title: How to solve java.lang.NullPointerException error?
body: <p>When I run my Java program, it gives me an error on this line </p>
  
  <p><code>compiler.getTask(null, null, new DiagnosticCollector&lt;JavaFileObject&gt;(), null, null, compilationUnits);</code> </p>
  
  <p>Error I am getting is:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at AnotherClassLoader.loadClass(test.java:58)
      at test.main(test.java:30)
      at Main.main(Main.java:68)
  </code></pre>
  
  <p>Can you please tell me how can I solve this error?</p>