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!

AttachCurrentThread not setting 'env' parameter

573044May 4 2011 — edited May 4 2011
Here are a bunch of snippets of my code (written in Pascal). I tried to grab all of the important parts - let me know if I missed anything.
//type declarations
PJavaVM  = ^JavaVM; 
PJNIEnv = ^JNIEnv;
...
//global variable
var
  MainJVM : JavaType.PJavaVM;
...
// Setting the 'MainJVM' variable (from the main thread) within a procedure
var
  env : JavaType.PJNIEnv
...
env^^.GetJavaVM(env,MainJVM);
...
// Attaching MainJVM's thread to 'env' (which isn't working) within a procedure
var
  env : JavaType.PJNIEnv;
...
MainJVM^^.AttachCurrentThread(MainJVM,@env,nil)
Everything seems to be working up to the 'AttachCurrentThread' line. That line returns a 0 but the value of 'env' isn't updated.

Thanks!

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 1 2011
Added on May 4 2011
2 comments
279 views