4

We have been working fine using JACOB to produce PDFs using a 32 bit JVM for many years without a problem, using Jacob.jar and Jacob.dll. We now need to upgrade to 64 bit JVM for various reasons. I have downloaded the latest Jacob.jar and dll for 64 bit and installed and added to the path, but when I run, I get:

com.jacob.com.ComFailException: Can't co-create object
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:160)
at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:54)
at ...

I am working with jre 1.8.0_131, the manifest for the Jacob.jar is:-

Manifest-Version: 1.0 
Ant-Version: Apache Ant 1.9.2 
Created-By: 1.7.0_79-b15 (Oracle Corporation) 
Built-By: joe
Name: com.jacob 
Specification-Title: JACOB : Java COM Bridge 
Specification-Vendor: http://jacob-project.sourceforge.net 
Implementation-Title: JACOB : Java COM Bridge Java libraries 
Implementation-Version: 1.18 build 01 on 05-August-2015 05:01:11 
Trusted-Library: true 
Application-Name: Java-Windows Bridge 
Permissions: all-permissions 
Codebase: *

and the Jacob dll is Jacob-1.18-x64.dll

Has anybody out there had success with JACOB with a 64 bit JVM. Specifically for producing PDFs? Any advice would be helpful as I have been battling this for some time! Other stack overflow threads that I read:- Can't co-create object

Many Thanks

Lonzak
  • 9,334
  • 5
  • 57
  • 88
yogibeare
  • 41
  • 1
  • 3
  • We are using jacob in 32 and 64 Bit environments. However in combination with an applet and not for PDF generation but for outlook access. Which java version were you using for the 32Bit version? Your pdf generation library is also 64Bit? – Lonzak May 15 '17 at 08:49

1 Answers1

0

I got it working with java 1.8 and Jacob-1.19-x64.dll like so:

  • copy the dll into:

    1. C:\Windows\SysWOW64\

    2. C:\Program Files\Java\jdk1.8.0_141\lib

    3. C:\Program Files\Java\jdk1.8.0_141\bin

  • Add in the registry the entry DllSurrogate in the key HKCRWow6432NodeAppID{E2779C61-F87E-4038-98A0-1D9E71334706} without a value.

  • Create a new key in HKLMSoftwareClassesAppID with the GUID {E2779C61-F87E-4038-98A0-1D9E71334706} without any values.


Source:

aminator
  • 396
  • 7
  • 18