Question

I was working on a software that till now supports only JNI and not JVMTI. But I am not able to make clear distinction that why actually JVMTI is helpful and if it was working previously with JNI than what JVMTI is going to add to it, as they seem to be doing somewhat same kind of work.

Était-ce utile?

La solution

JNI, as the name suggests, serves the purpose of integrating native code into your Java applications. Which means you can call a function written in C from your java code.

Now JVMTI doesn't necessarily add anything to JNI as it serves a completely different purpose. It provides means of communication between a JVMTI agent and the Java Virtual Machine for tools like profilers, debuggers etc... It merely uses the JNI, but doesn't really add anything to it.

Autres conseils

JNI makes Java applications have the abilities to use libraries implemented by other languages(for example,c/c++ or assemble language). It provides JVM vendors and application developers a standard interface of VM.

JVMTI is the lowest level of JPDA. This picture illustrates it: http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/architecture.html

       Components                          Debugger Interfaces
            /    |--------------|
           /     |     VM       |      <------- JVM TI
           \     |   back-end   |
            \    |--------------|
            /           |              <------- JDWP 
            \           |
                 |--------------|
                 | front-end    |
                 |--------------|      <------- JDI 
                 |      UI      |
                 |--------------|

In a word, JVMTI just uses JNI.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top