0

I am running an existing application which should ideally be working fine. But when I run the code in my machine the following code throws an exception

ComThread.InitMTA();

Exceptionjava.lang.NoClassDefFoundError: Could not initialize class com.jacob.com.ComThread

I have jacob.jar in my class path(WEB-INF\lib) and has also placed the corresponding dll in my Windows System32 folder. Please help.

Also my windows is 64 bit but I run the 32 bit version of java (for both project and eclipse).

IS_EV
  • 988
  • 2
  • 15
  • 29

2 Answers2

1

I recently ran into this problem as well. This is the exception you'll see when the jacob dll is not found. It's really throwing an UnsatisfiedLinkError in a static initializer, but that ends up not affecting you until you try to load a class whose static initializer failed. The version of the dll (32 or 64 bit) required needs to match the JVM. You have a few options:

  1. If you're using something like Eclipse, then put the dll on your classpath or add to your Eclipse Run Configuration another classpath entry with the location of your dll.
  2. If you're using webstart, then you'll need to use the nativelib entry for a jar containing the dll.
  3. Add the location of your dll to the jvm using java.library.path
  4. You can hardcode the path to the dll using jacob.dll.path
amos
  • 5,092
  • 4
  • 34
  • 43
0

You need to change a jacob.jar version,1.11 version try

sunysen
  • 2,265
  • 1
  • 12
  • 13