Question

Below are my project boundaries

Windows 7 64bit

jre 1.6 64 bit

jacob dll (jacob-1.17-M2-x64.dll)

Problem is

jacob-1.17-M2-x64.dll is supporting in jre 1.7 but not with jre 1.6

Exception thrown

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.17-M2-x64 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.jacob.com.LibraryLoader.loadJacobLibrary(LibraryLoader.java:184)
    at com.jacob.com.JacobObject.<clinit>(JacobObject.java:107)
    at com.osg.sqe.env.framework.control.web.Outlook.main(Outlook.java:14)

Please dont treat it as a replicated question as my question is not "java.library.path" issue because i am able to run the application with jre1.7 without any problem.

Was it helpful?

Solution

This is not true. I just ran jacob-1.17-M2-x64 using the following commands:

%java% -Djava.library.path=%jacobPath% -cp %cp% %class%

If I type a wrong path to jacob, then I get a message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.17-M2-x64 in java.library.path

java -version:

java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

And this is my whole script:

@echo off
set jacobPath=C:\lang\java\jacob-1.17-M2
set cp=.;%jacobPath%\jacob.jar
set class=JacobFso
rem following line was to test 32-bit version
rem set java="C:\Program Files (x86)\Java\jre6\bin\java.exe"
set java=java.exe
set jdk=C:\Program Files\Java\jdk1.6.0_30\bin
"%jdk%\javac.exe" -cp %cp% %class%.java
if errorlevel 1 goto leave
rem my real, longer line, which I usually use
rem %java% -Djava.library.path=%jacobPath% -cp %cp% -Xms5m -Xss5m -Xmx5m -Dcom.jacob.debug=false -Dcom.jacob.autogc=false %class%
%java% -Djava.library.path=%jacobPath% -cp %cp% %class%
:leave

OTHER TIPS

Import that dll as native library in eclipse. Then it will work definitely

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top