title: Capture the java exception in bat file
body: <p>In my project, I call java program from the command window. I have a bat file like the following. I throw a RuntimeException in Test class. With "|| exit /b 1", all the commands after ""%JAVA_HOME%\bin\java" -cp "bin/" Test %RUN_ARGS% || exit /b 1" will be skipped. </p>
  
  <p>Can anybody tell me what "|| exit /b 1" does? What is the meaning of "||" in the command line?</p>
  
  <hr>
  
  <pre><code>@echo off
  setlocal
  
  set RUN_ARGS=%*
  
  "%JAVA_HOME%\bin\java" -cp "bin/" Test %RUN_ARGS% || exit /b 1
  
  echo %RUN_ARGS%
  
  dir
  
  endlocal
  exit /b 0
  </code></pre>
  
  <hr>