Topic
  • 3 replies
  • Latest Post - ‏2013-02-12T19:20:28Z by SystemAdmin
SystemAdmin
SystemAdmin
2736 Posts

Pinned topic IBM JDK7 - jni: class: JNIEnv, function: DefineClass() returns unexpected 0

‏2013-01-31T14:19:16Z |
I have got code that is using JVMTI.
During VMInit event I am invoking method DefineClass()
env->DefineClass("someClass", NULL, (jbyte *)class_data, sizeof(class_data));

This method should return me memory address to this class.
Unfortunatelly it is returning 0.
I tested this code using 1.5, 1.6, 1.7 Sun/Oracle Java and it works correctly.
Using IBM Java:
java version "1.7.0"
Java(TM) SE Runtime Environment (build pwa6470sr1-20120405_01(SR1))
IBM J9 VM (build 2.6, JRE 1.7.0 Windows 7 amd64-64 20120322_106209 (JIT enabled, AOT enabled)
J9VM - R26_Java726_SR1_20120322_1720_B106209
JIT - r11_20120322_22976
GC - R26_Java726_SR1_20120322_1720_B106209
J9CL - 20120322_106209)
JCL - 20120322_01 based on Oracle 7u3-b05
it isn't works for me.

My question is:
1. There is any bug that this method doesn't working?
2. If 1 is not true then what could be wrong?
3. It probably works correctly on IBM JDK 6 but I should recheck it to be sure. Where could I download IBM JDK 6? I could found only latest releases. I need 6th version for Windows 64bit.
Updated on 2013-02-12T19:20:28Z at 2013-02-12T19:20:28Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2736 Posts

    Re: IBM JDK7 - jni: class: JNIEnv, function: DefineClass() returns unexpected 0

    ‏2013-01-31T15:01:06Z  
    I do not know which section is the best for this question so I choosed this with most views.
    Imho it could fit also to:
    • Java Virtual Machine (JVM) and Bytecode
    • IBM SDK for Java 7.0
  • SystemAdmin
    SystemAdmin
    2736 Posts

    Re: IBM JDK7 - jni: class: JNIEnv, function: DefineClass() returns unexpected 0

    ‏2013-02-12T19:19:19Z  
    Ok, I found a solution. It is just a difference in threating special naming classes.
  • SystemAdmin
    SystemAdmin
    2736 Posts

    Re: IBM JDK7 - jni: class: JNIEnv, function: DefineClass() returns unexpected 0

    ‏2013-02-12T19:20:28Z  
    Ok, I found a solution. It is just a difference in threating special naming classes.