Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ application with JNI throws an error "jvm.dll not found . re-installing the application could fix ...."

I have written a plain C++ application in VC6 that is using jni to call up a method in java. For doing so, I have included jni.h and other lib folders in the project directories.

the code compiles but when i run teh application it fails saying "jvm.dll is not found. reinstalling the application would fix it". But the jvm.dll is present in my pc.

If i set the working directory of the application to the location where the jvm.dll is, then it works like a charm. I cannot set the working directory of the application to the directory of jvm.dll as this application is going to be a dll in future.

I tried also updating the PATH variable in the system variables to the location of jvm.dll, but nothing works..

I suspect that the jvm.lib is loading the jvm.dll from certain directory location which is not provided by my application .. hence its failing,..

Please suggest me what is going wrong.

Thanks in advance.

Regards Raghavendra

like image 804
user1821083 Avatar asked Nov 13 '22 17:11

user1821083


1 Answers

it fails saying "jvm.dll is not found. reinstalling the application would fix it".

Obviously that's your own error message, or Windows': not Java's, and it's incorrect. Reinstalling the application can't possibly have any effect on whether jvm.dll can be found.

You need to ensure that jvm.dll is on your PATH.

like image 151
user207421 Avatar answered Jan 04 '23 01:01

user207421