Thanks to technomage for helping me find the solution.
Apparently VS manipulates environment variables in its context. So I just had to set it again in the post-build event using the following:
set PATH=%PATH%;path_to_jvm.dll
"$(TargetPath)"
Pergunta
I have a project that runs its output as a post-build event. Also this application uses JNI functions and thus needs to load jvm.dll
(it is loaded automatically using jvm.lib
).
However if I enter the same command line as a post-build event I get the following error:
This application has failed to start because jvm.dll was not found. Re-installing the application may fix this problem.
I have added the path to jvm.dll to my PATH environment variable already. I'm not sure why it cannot find it.
Solução
Thanks to technomage for helping me find the solution.
Apparently VS manipulates environment variables in its context. So I just had to set it again in the post-build event using the following:
set PATH=%PATH%;path_to_jvm.dll
"$(TargetPath)"