1

Problem in resolving jacob-1.18-x86.dll , it cannot accessed at run time while i can successfully compile program.

SEVERE: Servlet.service() for servlet dispatcher threw exception
    java.lang.UnsatisfiedLinkError: no jacob-1.14.3-x64 in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:184)
        at com.jacob.com.JacobObject.<clinit>(JacobObject.java:108)

Maven dependency is :

<dependency>
    <groupId>net.sf.jacob-project</groupId>
    <artifactId>jacob</artifactId>
    <version>${jacob.version}</version>
</dependency>

<dependency> 
    <groupId>net.sf.jacob-project</groupId> 
    <artifactId>jacob</artifactId> 
    <version>1.14.3</version> 
    <classifier>x64</classifier> 
    <type>dll</type> 
</dependency> 
M. Prokhorov
  • 3,894
  • 25
  • 39

4 Answers4

4

Have you put JACOB .dll files into your runtime library path? E.g. in the folders:

/Java/jdk/jre/bin

and

/Java/jdk/jre/lib/ext/jacob-1.18

Summer256
  • 56
  • 5
  • C:\Program Files\Java\jdk1.8.0_162\jre\bin – Devendra Singraul Apr 02 '18 at 05:24
  • Yes i did that and checked still i am getting same error – Devendra Singraul Apr 02 '18 at 07:41
  • java.lang.UnsatisfiedLinkError: no jacob-1.14.3-x64 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:184) at com.jacob.com.JacobObject.(JacobObject.java:108) at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:181) at com.jacob.com.ComThread.(ComThread.java:167) – Devendra Singraul Apr 02 '18 at 07:41
  • Thank you very much. I was missing to add jacob-1.14.3-x64.ddl and jacob-1.14.3-x84.dll both – Devendra Singraul Apr 02 '18 at 09:35
1

Now it is resolved when i added following files :

jacob-1.14.3-x64.ddl and jacob-1.14.3-x84.dll

inside folders :

/Java/jdk/jre/bin and /Java/jdk/jre/lib/ext

0

I've managed to solve my problem by adding the jacob-1.19-x64.dll file in the first folder of System.getProperty("java.library.path").

Just system.out the property and copy the .dll file in the folder.

J-Alex
  • 6,881
  • 10
  • 46
  • 64
saravh
  • 1
  • 1
0

It's not always possible to add the dll to a folder from java.library.path. Hope this solution helps others.

Struggled with this a bit before I looked at the source code for loading the dll. Add the below code before calling any methods from the Jacob library. This will instruct Jacob to load the dll from the specified path instead of looking in java.library.path.

System.setProperty("jacob.dll.path", "/path/to/your/jacob/jacob-1.18-x86.dll");

Works for version 1.20. But should work for older versions as well.