1

I'm newbie in batch programming (I don't know much about batch files). My boss has asked me to write a batch file that runs a Java application. The batch file has something like this:

echo ロックテーブル削除

java -cp n:\kanesin.root\bin\Sys.Boundary.BatchMain.jar /JobID:BCM0020  
if not ERRORLEVEL 0 (
    echo Teiji_H01.bat BCM0020 > rerun.bat
    goto ERROREXIT
)

but I don't know how the Java application sends the ERRORLEVEL to this batch file. Do I have to return an integer value, or use System.exit(number); ?

1 Answer 1

3

Do I have to return an integer value, or use System.exit(number); ?

Yes. You set that by using System.exit(int) which (per the Javadoc)

Terminates the currently running Java Virtual Machine. The argument serves as a status code; by convention, a nonzero status code indicates abnormal termination.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.