R
R
ruboss2015-11-18 20:06:35
linux
ruboss, 2015-11-18 20:06:35

Why doesn't java see the library?

Hello everyone, there was a problem with connecting the library on linux ubuntu.
The folder /mnt/contains the files necessary to run. treedb.jar и jkyotocabinet.so
I look at what is in the current folder:

[email protected]:/mnt# ls -l

-rwxr-xr-x 1 root root 1948919 Mar 11  2014 jkyotocabinet.so
-rwxr-xr-x 1 root root 1404322 Nov 18 16:11 treedb.jar

I run the program with the parameter"-Djava.library.path=."
[email protected]:/mnt# sudo java -Xms5000m -Xmx51000m -d64 -jar -Djava.library.path=. treedb.jar

In the program I output to the console:
current dir = /mnt/.
java library path = .

And System.loadLibrary("jkyotocabinet");then an exception occurs on the line:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jkyotocabinet in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
        at java.lang.Runtime.loadLibrary0(Runtime.java:849)
        at java.lang.System.loadLibrary(System.java:1088)
        at treedb.Main.main(Main.java:27)

I also looked in java -XshowSettings:propertiesand threw it jkyotocabinet.sointo folders that were already in java.library.path. I installed it programmatically. System.setProperty( "java.library.path", "." );
Nothing helps, do you have any ideas what the problem is, why does Java not see the library? On Windows I do the same, only .dll instead of .so and everything works fine

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kileev, 2015-11-18
@akileev

Library and JVM of the same bitness (32/64-bit)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question