how to get exit code from JNI

Discussion in 'C++' started by Liang Zhang, Jul 14, 2006.

  1. Liang Zhang

    Liang Zhang Guest

    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



    --

    Best Regards

    Liang Zhang

    Developer
    SAP Labs China

    T: +86 21 61006699-7775
    F: +86 21 65984520
    Email

    SAP LABS CHINA : INNOVATE THE FUTURE
     
    Liang Zhang, Jul 14, 2006
    #1
    1. Advertising

  2. * Liang Zhang:
    > in my project, i need to call a java method from C code using JNI


    And why are you posting that question in a C++ group?

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Jul 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuZHk=?=

    Code to Exit Web App and Exit Internet Explorer

    =?Utf-8?B?U2FuZHk=?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    7,904
    =?Utf-8?B?U2FuZHk=?=
    Aug 5, 2005
  2. Joe Smith
    Replies:
    4
    Views:
    65,860
    sandeep1976
    Nov 8, 2006
  3. Replies:
    2
    Views:
    459
    Jeff Epler
    May 31, 2005
  4. Yujo
    Replies:
    2
    Views:
    406
    Gabriel Genellina
    Apr 10, 2007
  5. chad
    Replies:
    14
    Views:
    581
    Arnaud Delobelle
    Oct 13, 2010
Loading...

Share This Page