By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,734 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,734 IT Pros & Developers. It's quick & easy.

java.lang.NullPointerException Error when compiling java application

mickey0
100+
P: 142
Hello,
I have my class file 'MyClass'; I would like compile it from my application; I wrote it but I got a java.lang.NullPointerException
Any reasons for this?
thanks.
Expand|Select|Wrap|Line Numbers
  1. JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
  2.                 int res =  compiler.run(null, null, null, "MyClass.java" );           //here exception
  3.  
Jul 12 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.