java.lang.NullPointerException Error when compiling java application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mickey0
    New Member
    • Jan 2008
    • 142

    java.lang.NullPointerException Error when compiling java application

    Hello,
    I have my class file 'MyClass'; I would like compile it from my application; I wrote it but I got a java.lang.NullP ointerException
    Any reasons for this?
    thanks.
    Code:
    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    	    		int res =  compiler.run(null, null, null, "MyClass.java" );           //here exception
Working...