title: Displaying and copying output of a java program from command prompt into a file
body: <p>i have a Java program which takes input from Users and displays output according to the input. The Program provides the user with a menu of options and the user is required to select one option from the menu. </p>
  
  <p>Now i have to run this program through a batch file and stream the output of this program into another file. I achieve this by using the following code in the bat file.</p>
  
  <pre><code>java -jar ./dist/MP4.jar &gt; ./docs/mp4out.txt
  </code></pre>
  
  <p>But when this bat file is run the command prompt will never display the menu and ask the user input as all the java program output is redirected into the file. So my question is how can i make the command prompt to show the menu and wait for the user input and also redirect all the programs output into a file?</p>