[英]How to create Java VM in C?
I have written code to create Java VM: 我已经编写了创建Java VM的代码:
JNI_CreateJavaVM(&vm, (void **) &env, (void *)&args);
And when I run my program this text shows: 当我运行程序时,此文本显示:
jvm.dll not found
找不到jvm.dll
and I copied "jvm.dll" to the main directory of program. 然后将“ jvm.dll”复制到程序的主目录。 Now I have this message in console:
现在,我在控制台中收到此消息:
Error occurred during initialization of VM
VM初始化期间发生错误
Unable to load native library: Can't find dependent libraries
无法加载本机库:找不到依赖库
How can I fix it? 我该如何解决?
您需要将库路径设置为VM参数,并确保/path/to/dir
中存在所有必需的.dll
文件:
-Djava.library.path=/path/to/dir
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.