title: How to export java project with batch file inside
body: <pre><code>    import java.io.BufferedReader;
      import java.io.InputStream;
      import java.io.InputStreamReader;
  
  
  
  public class Main {
  
      public static void main(String[] args) throws Exception {
  
          InputStream PROGRAM = Main.class.getClassLoader().getResourceAsStream("FILES/PROGRAM.bat"); 
          converter(PROGRAM);
          String s = "" + PROGRAM;
          System.out.println(s);
          Runtime.getRuntime().exec("cmd.exe /c start "+s);
      }
  
      static String converter(InputStream a)throws Exception{
          InputStream in = a;
          InputStreamReader is = new InputStreamReader(in);
          StringBuilder sb=new StringBuilder();
          BufferedReader br = new BufferedReader(is);
          String read = br.readLine();
  
          while(read != null) {
              sb.append(read);
              read =br.readLine();
              }
  
          return sb.toString();
      }
  
  
  
  }
  </code></pre>
  
  <p>What I'm trying to do is to export this project into Jar file, and I need to import this Batch file like this:
      InputStream PROGRAM = Main.class.getClassLoader().getResourceAsStream("FILES/PROGRAM.bat");
  So it can work in any other computer.</p>