Solved

System.exit(0)  - basic JNI problem

Posted on 2004-11-02
772 Views
Last Modified: 2008-03-04
Hi there,

I open C++ GUI application from Java (using JNI native call). When user clicks "x" and closes GUI application, I'd like to shutdown JVM also. In my code, when user clicks "x", C++ side calls Java method (that contains System.exit(0) call) and this results in the java.exe - Application Error: "The instruction at 0x0 referenced at 0x0. The memory couldn't be read".

I use Jace to handle JNI calls but this sounds like a pure JNI problem.

Many thanks in advance.

Kalle.
0
Question by:kalle73
    6 Comments
     
    LVL 24

    Expert Comment

    by:sciuriware
    Could you just do      exit(0); from C++?
    ;JOOP!
    0
     

    Author Comment

    by:kalle73
    But I need to close JVM also.
    0
     
    LVL 24

    Accepted Solution

    by:
    No it's alltogether only one program.
    ;JOOP!
    0
     

    Author Comment

    by:kalle73
    right you are, so simple
    0
     

    Author Comment

    by:kalle73
    Thanks
    0
     
    LVL 24

    Expert Comment

    by:sciuriware
    My pleasure,

    ;JOOP!
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT Security CISA, CISSP & CISM Certification

    Master the advanced techniques required to protect network resources from external threats with the IT Cyber Security bundle. Built around industry best-practice guidelines, the IT Cyber Security bundle consists of three in-depth courses.

    Suggested Solutions

    Title # Comments Views Activity
    sum67 challenge 35 68
    Getting Conflicting setter definitions for property error in spring 5 50
    hash value 2 22
    mergeTwo  challenge 13 42
    If you have upgraded to Java2 update 10 on a Microsoft Windows client, you may have discovered that your Java application does not work as it did before.  For example, the colors of your Java2D graphic may be all wrong for no apparent reason. Aft…
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now