• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Spring 3 and load JNI/.so library

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

My question is:

how is possible to dinamic load JNI or .so file from spring.
in my project i have a lib where i have added different jar files and all work well but if i add the library jar with a jnilib file ( for example in a mac osx leon ) when i charge the library


i obtain this error
java.lang.UnsatisfiedLinkError: no chilkat in java.library.path

so, have a method to use the jsni or .so library without move de shared library to hava.library.path?

thank's
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is handled by the JVM - Spring doesn't really have anything to do with it.

Is this your code or a third party library you are using? If it's your code, you can use System.load() instead of System.loadLibrary() - System.loadLibrary() only loads from the java.library.path, but System.load() can load from any location. Some libraries package their native dependencies inside their JAR, extract them to a pre-defined location, and use System.load() to load them from that location.

If it's a third party library using System.loadLibrary(), it's probably easier to just add to the java.library.path - you can either set the PATH environment variable to point to the directory that contains the library, or specify java.library.path when starting the JVM - this is done by setting the property - by passing -Djava.library.path=... as a command-line argument.
 
andrea mucci
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank's Nath

mmmm, my problem is that i work with an hosting system, cloudfoundry.com and i can't modify the jvm instances.
the library is JavaCV a wrapper of openCV

anyway, thank's for your help
 
It will give me the powers of the gods. Not bad for a tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic