Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

How to load a DLL bundled in a JAR ?

Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to load a DLL which is bundled in a JAR. If I do not include them in a JAR, I can load the DLL with System.load(thePath). This works fine.
Now to load it from a JAR i do this:
// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();

// Create path
String lsFile = new String((cl.getResource("STDCExcel.dll")).getPath());
// load DLL
The System.load gives me a unsatisfiedlinkError, the lsPath variable contains: file:/C:/JRE/1.3.1/lib/ext/office.jar!/STDCExcel.dll
The Office.jar is infact the correct JAR which contains the DLL.
What's wrong ?? thnx
The human mind is a dangerous plaything. This tiny ad is pretty safe:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic