Tuesday, 12 July 2016

How to solve java.lang.NullPointerException error?

When I run my Java program, it gives me an error on this line



compiler.getTask(null, null, new DiagnosticCollector(), null, null, compilationUnits);



Error I am getting is:



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)


Can you please tell me how can I solve this error?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...