Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JVM 1

Status
Not open for further replies.

advait75

Programmer
Oct 5, 2002
48
IN
Hi I am trying to bring up JVM from a C program. I am using the following command to link -
cl -ID:\j2sdk1.4.2_05\include -ID:\j2sdk1.4.2_05\include\win32 -MT invoke.c -link D:\j2sdk1.4.2_05\lib\jvm.lib

However, I keep getting the following error. I am running Windows XP, VC++ 6.0 and j2dk 1.4.2_05. Does anybody know what to do?

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

invoke.c
invoke.c(34) : warning C4047: 'function' : 'void ** ' differs in levels of indir
ection from 'const struct JNINativeInterface_ *** '
invoke.c(34) : warning C4022: 'JNI_CreateJavaVM' : pointer mismatch for actual p
arameter 2
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:invoke.exe
D:\j2sdk1.4.2_05\lib\jvm.lib
invoke.obj
 
How are you trying to call the VM? Is it via the GetJavaVM(JNIEnv *env, JavaVM **vm) API? This is how you invoke the VM from a C app. Here is a good tutorial:


If you are doing this make sure same version of java is same. Type Java -version to get actual version. Compare that with lib version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top