How to read java exit code from a shell script...

Java Class class Hello{ public static void main(String args[]){ System.out.println("Hello world!!!!"); System.exit(10); } } Shell script #!/bin/bash java Hello exitValue=$? echo "Exit Code : " $exitValue Output Hello world!!!! Exit code : 10
sumedha's picture

How to read java exit code

Same can be done from a windows bat file as follows..

echo off
java Hello
echo %ERRORLEVEL%

Latest Webinar
In this webinar we'll share the range of concerns we've heard from the industry, and survey some of the new and sometimes subtle types of lock-in associated with cloud technologies.
Wednesday, 8 September, 10.00 AM (PDT)