0

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.

sayannayas
  • 764
  • 9
  • 15

2 Answers2

0

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
Jarekczek
  • 7,456
  • 3
  • 46
  • 66
  • can you confirm this with a 1.7 jre version? also i have set the library path at run-time by using System.loadLibrary function which i had sucessesfull run with 1.6...thanks – sayannayas Oct 24 '12 at 06:52
  • Sorry there was a typo ,mine is working with 1.7 and NOT 1.6 ,i just want to compare my observation regarding this,anyway thanks for your reply ,it is definitely somewhere my fault ,can you please mention how to use -djava? – sayannayas Oct 24 '12 at 08:40
  • I added my whole script, hope this helps. It worked for me fine with both 32 and 64 bit java. My default `java.exe` is 64-bit. – Jarekczek Oct 24 '12 at 09:17
0

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