title: how to run .exe file of a java file in other computers
body: <p>I have developed a java code in eclipse.My code reads data from a .txt file by using server_ip. I have created an executable jar file of the code and then created an .exe file using launch4j. The .exe file shows data if I run it in my laptop,but it does not show any data if I run it in other pc. then it shows null point exception. my operating system is windows 7-32 bit. I am giving my code here. please give me solutions.</p>
  
  <p>package remotedata;</p>
  
  <pre><code>import java.awt.*; 
  </code></pre>
  
  <p>import java.net.<em>; 
  import java.io.</em>; </p>
  
  <pre><code>public class remotedataread extends Frame
  { 
      public static void main(String[] args)
              throws InterruptedException, IOException{
  
          BufferedReader br = null;
          TextArea FileText = 
          new TextArea(" Content of the File \'temp1.txt\' :"); 
  
          try
          {   
              URL url = 
                  new URL("file://server_ip/path_file.txt");
  
                          InputStream is = url.openStream(); 
                          br = new BufferedReader(new InputStreamReader(is));
                       /*   String line = null;
                          while (true) {
                              line = br.readLine();
                              if (line == null) {
                                  //wait until there is more of the file for us to read
                                  Thread.sleep(1000);
                              }
                              else {
                                  System.out.println(line);
                              }
                          }*/
          }
  
  
          catch (MalformedURLException e)
          {
              System.out.println("Bad URL");
          }
          catch (IOException e)
          {
              System.out.println("IO Error : "+e.getMessage());
          }   
  
          FileText.setBackground(Color.white);
          FileText.append(String.valueOf('\n'));
  
          Frame f = new Frame("server data");
          f.setSize(200,200);
          f.add(FileText); 
          f.setVisible(true);
  
          try
          {
              String s;
              s=null;
              boolean eof = false;
              //while (true) {
              s = br.readLine();
              System.out.println("Time    Temperature");
              while( !eof )
              {
                  FileText.append(s + String.valueOf('\n'));
                  try
                  {
                      s = br.readLine();
                      if ( s == null )
                      {
                                  //  eof = true;
                      //  br.close();
                           Thread.sleep(1000);
  
                      }
                      else{
                          //System.out.println("Time  Temperature");
                          System.out.println(s);
                      }
  
                  }
                  catch (EOFException eo)
                          {
                                  eof = true;
                          }
                  catch (IOException e)
                          {
                                  System.out.println("IO Error : "+e.getMessage());
                          }
              }
              //}
  
          }
          catch (IOException e)
                  {
                          System.out.println("IO Error : "+e.getMessage());
                  }
  
      } 
  
  }
  </code></pre>