Unable to load DLL 'jvm.dll': The specified module could not be found.

2,062 views
Skip to first unread message

instantdelay

unread,
Feb 10, 2011, 2:45:56 PM2/10/11
to jni4net
I'm having a problem getting jni4net to run at all on my computer. I
have a blank 32-bit c# project that includes jni4net.j-0.8.2.0.jar and
jni4net.n-0.8.2.0.dll.

When I try to run this line:
Bridge.CreateJVM(new BridgeSetup());
It fails with:
The type initializer for 'net.sf.jni4net.jni.JNI' threw an exception.
Unable to load DLL 'jvm.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)

I have JAVA_HOME set to "C:\Program Files (x86)\Java\jdk1.6.0_23".
This is on windows 7 64-bit but since I'm creating a 32-bit c#
application I'm using the 32-bit JDK. (Out of desperation I also tried
setting JAVA_HOME to a 64-bit JDK but that failed with "Can't
initialize jni4net. (32bit vs 64bit JVM vs CLR ?)")

I read somewhere that a DllImport will fail if the dll depends on
other dlls that can't be found. I ran dumpbin /depends on "C:\Program
Files (x86)\Java\jdk1.6.0_23\jre\bin\server\jvm.dll" and it came back
with kernel32.dll, user32,dll, advapi32.dll, winmm.dll, and
msvcr71.dll. All of those were in my PATH except msvcr71.dll. I copied
that from the jre/bin folder into system32 but that didn't help
either.

How do I get jni4net to work on my system?

Pavel Šavara

unread,
Feb 10, 2011, 3:06:47 PM2/10/11
to jni...@googlegroups.com
Hi Spencer,

first of all try this
http://jni4net.sourceforge.net/troubleshoot.shtml
but it seems to me you did already.

The I recommend trying samples included with binaries.
Try to avoid your own VS solution to eliminate your own mistakes.
If proxygen itself could generate the files, it's good.

I think other guy reported similar problem into this group some time
ago, but we didn't reached any conclusion.
So, please don't give up. We all want to know :)

I wonder if it could be
c:\Program Files (x86)\Java\jdk1.6.0_22\jre\bin\client\jvm.dll
vs
c:\Program Files (x86)\Java\jdk1.6.0_22\jre\bin\server\jvm.dll

Pavel

> --
> You received this message because you are subscribed to jni...@googlegroups.com
> http://groups.google.com/group/jni4net?hl=en-GB?hl=en-GB
> http://jni4net.sf.net/
>

Reply all
Reply to author
Forward
0 new messages