Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to get exit code from JNI

843829Jul 13 2006 — edited Jul 15 2006
Hi, All
in my project, i need to call a java method from C code using JNI, yet I do
not know how to
retrieve the exit code of java program. the java code is like below
....
public static void main(....)
{
.....

if(error){
System.exit(-77);// the exit code is -77
....
}
and the JNI c code may like below
.....
/* Invoke main method. */
(*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
//here I want to retrieve the exit code from java to check if there is an
error
...
--

any suggestions? thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2006
Added on Jul 13 2006
1 comment
337 views