3

I am trying to initialize JUnixSocket in JRuby but it is failing as it is unable to locate the native library. I am getting error :

java.lang.UnsatisfiedLinkError: Could not load junixsocket library, tried [/opt/newsclub/lib-native/libjunixsocket-linux-1.7-amd64.so, /opt/newsclub/lib-native/libjunixsocket-linux-1.5-amd64.so, lib:junixsocket-linux-1.7-amd64, lib:junixsocket-linux-1.5-amd64]; please define system property org.newsclub.net.unix.library.path

Command which I am trying to execute:

irb(main):015:0> java_import 'org.newsclub.net.unix.AFUNIXSocket'
irb(main):016:0> AFUNIXSocket.newInstance()

I have the following libraries in folder lib: libjunixsocket-linux-1.5-amd64.so libjunixsocket-linux-1.5-i386.so.

Is it possible to specify path of library in irb so that it can get the library? Any approach which can solve above problem will be appreciated.

JoshDM
  • 4,939
  • 7
  • 43
  • 72
rajsekhar
  • 403
  • 1
  • 5
  • 14

1 Answers1

2

You can specify -J-Djava.library.path=$LD_LIBRARY_PATH in your jvm server configuration file. Here $LD_LIBRARY_PATH should contain paths to your native libraries.

rajsekhar
  • 403
  • 1
  • 5
  • 14