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!

jboolean problem

843829Mar 17 2004 — edited Mar 17 2004
Hi i am trying to pass a boolean variable from Java to C.
Java code is as follows
boolean bool=true;
encrypt(bool);
C code
JNIEXPORT void JNICALL Java_signJavav1_encrypt (JNIEnv * jEnv, jobject obj,jboolean b){
printf(msg,"boolean= %s\n",(b==JNI_TRUE ? "true" : "false" ));

if(b){
do this
}
else{
do this
}
}

This code seems to work only if the bool value is true. when i change the bool value in java, it does not go into the else part. Am i commiting a mistake anywhere?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2004
Added on Mar 17 2004
1 comment
192 views