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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JNI_CreateJavaVM failure? causes??

843829Aug 14 2003 — edited Aug 14 2003
hi,
i am calling JNI_CreateJavaVM and it is failing. It is actually kicking me out of the C code after it fails. Does anyone know why this might be? I do execute a huge sort before I go into this. I am not sure of the amount of resources available to me afterward. I assume they are adequate, but that could be a source of problem. Does anyone have any ideas or suggestios? thanks

Comments

843829
Including your code thats causing the problems for you could help.

If you aren't loading in jvm.dll dynamically try it. I found that doing it this way got JNI working properly for me.
CreateJavaVM_t *CreateJavaVM;

	HINSTANCE handle;

	/* Load the Java VM DLL */
	if ((handle = LoadLibrary("d:\\j2sdk1.4.2\\jre\\bin\\client\\jvm.dll")) == NULL)
	{
		printf("Error:cannot load JVM");
		return NULL;
	}

	/* Now get the function addresses */
	CreateJavaVM = (CreateJavaVM_t *)GetProcAddress(handle, "JNI_CreateJavaVM");
	if (CreateJavaVM == NULL)
	{
		printf("Error: can't find JNI interfaces\n");
		return NULL;
	}
Of course you'll need to change the d:\\j2sdk1.4.2\\jre\\bin\\client\\jvm.dll to reflect the actual path of jvm.dll on your machine
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 11 2003
Added on Aug 14 2003
1 comment
185 views