title: Print writer not working in case of runnning a executable jar
body: <p>I created a backup program. Program is running great but the logs are not generating. I am generating logs using three methods ,</p>
  
  <pre><code>System.out.println(message);
  
          try {
  
              if(logFileWriter != null){
  
                  logFileWriter.write(message);
                  logFileWriter.newLine();
                  logFileWriter.flush();
              }
  
              Runtime.getRuntime().exec("echo " + message);
  
          } catch (IOException e1) {}
  </code></pre>
  
  <p>Log file initializer:  </p>
  
  <pre><code>private static void initLog() { 
      File logFileObj = new File(logFile); 
      try { 
          FileWriter fileWriter = new FileWriter(logFileObj); 
          logFileWriter = new BufferedWriter(fileWriter); 
      } catch (IOException e) { 
          e.printStackTrace(); 
      } 
  }
  </code></pre>
  
  <p>Here message is the message that I want to log. The file writer is initiated by the log file path given by the user at the run time using the command line argument.</p>
  
  <p>When i am trying to run the program using the eclipse, logs are creating but when i run the executable jar file, no logs are creating. What can be the reason.</p>