Pass return code from Java application to a .bat file.

I have a .bat file which will execute a Java application. I want to pass the return code from the java application to the ".bat" file.Could you please let me know, how can I accomplish this.
[204 byte] By [tijo_mariama] at [2007-11-26 16:20:50]
# 1
System.exit(<your return code - as an int - here>);
georgemca at 2007-7-8 22:44:27 > top of Java-index,Java Essentials,Java Programming...
# 2

I tried that, but it doesn't return the value...

In my Java app, I had System.exit(returnCode) and in the '.bat' file

I have

@echo off

java <myApp>

set returnCd=%?%

echo %returnCd

and it didn't return any value. What should I specify in set returnCd=%?% instead of ?

tijo_mariama at 2007-7-8 22:44:27 > top of Java-index,Java Essentials,Java Programming...
# 3
Got it. It should be ERRORLEVEL.
tijo_mariama at 2007-7-8 22:44:27 > top of Java-index,Java Essentials,Java Programming...