I have a Perl script that is calling a JAR file...
exec("$java_path/java -jar testjar.jar");
In the code I have a situation where the JAR file exits on a error (as intended). When I run the command on the Windows or Unix command line, the return code is "1". However, when I run the Perl script that calls the JAR, on Unix I get "1" but on Windows I get "0" (no error).
Note: On Windows I used "echo %errorlevel%" to get the return code immediately after running the JAR/script. On Unix I used "echo $?".
Why does this work on Unix but not on Windows?