View Single Post
Old 12-10-2004, 01:38 PM   #9 (permalink)
freesoft_2000
Code Monkey
 
Join Date: Oct 2004
Posts: 51
freesoft_2000 is on a distinguished road
Question

Hi everyone,

This is what i did so far but i always get the exception null pointer even though it is not empty but the program compiles with no errors

Here is part of the code

Code:
public void compile ()
{
     byte[] buffer1 = new byte[2048];
     int len = 0;
     String str9 = "C:ddk1.4/bin/javac";
     String str10 = "D:gui.java";
     String[] str11 = {str9, str10};
     File File11 = new File("C://JIDE_Errors.TXT");
     try
     {
       Runtime1 = Runtime.getRuntime();
       //The below command command line is where the exception 
       //occurs saying it is a null pointer exception

       Process1 = Runtime1.exec(str11);
       InputStream in = new BufferedInputStream(Process1.getErrorStream());
       FileOutputStream out = new FileOutputStream(File11);

       while((len = in.read(buffer1)) != -1)
       {
         out.write(buffer1, 0, len);
       }

       Process1.waitFor();

       if(Process1.exitValue() == 0)
       {
              System.out.println("Compilation Successful");
       }

       else
       {

       }

}
Am i missing something. I really do not understand why there is a null pointer exception.

I hope someone can help me with this problem

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

Last edited by Belisarius; 12-11-2004 at 09:24 AM.
freesoft_2000 is offline   Reply With Quote