I've created a JNI based application, a C++ program that calls methods in a Java class. This works great so long as jvm.dll exists in the path. I'd like to remove that restriction, and not have any dependency on jvm.dll. How can I build my application such that jvm is statically linked? My environment is VS2010, i tried changing "Code Generation: Runtime Library to Multi-Threaded (/MT)" (instead of DLL) but it was still dependent on the DLL.
Any other ideas?
Then my question is, how do I statically link with jvm.lib?
1. Get the VM source code
2. Modify the code so it represents a static library.
3. Modify the build so it creates a static library.
4. Build it
5. Use it in your code.
I course I wonder why you think this is necessary.
You do realize that you would still need to distribute the JDK jars right?