Sqlite java.lang.UnsatisfiedLinkError on Linux

I have a program that uses a Sqlite database. It works fine on Windows (exported jar or directly in Eclipse), but when I go to linux server (plan to use it at regular intervals, cron job). I export it to jar from Eclipse and package sqlite-jdbc4-3.8.2-SNAPSHOT.jar along with it. Mistake:

/$ /usr/bin/java -jar /home/username/Software.jar /home/username/
java.lang.UnsatisfiedLinkError: /tmp/sqlite-3.8.2-amd64-libsqlitejdbc.so: /tmp/sqlite-3.8.2-amd64-libsqlitejdbc.so: failed to map segment from shared object: Operation not permitted
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
    at org.sqlite.core.NativeDB._open(Native Method)
    at org.sqlite.core.DB.open(DB.java:161)
    at org.sqlite.core.CoreConnection.open(CoreConnection.java:145)
    at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:66)
    at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:21)
    at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23)
    at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:44)
    at org.sqlite.JDBC.createConnection(JDBC.java:113)
    at org.sqlite.JDBC.connect(JDBC.java:87)
    at java.sql.DriverManager.getConnection(DriverManager.java:582)
    at java.sql.DriverManager.getConnection(DriverManager.java:207)
    ....

      

So, before you ask, I made sure sqlite-3.8.2-amd64-libsqlitejdbc.so in / tmp / has all permissions (rwxrwxrwx). However, this native library is causing problems. However, it is copied to / tmp / folder. It is said that I completely suck Linux ... and for this reason I have almost no idea what to try next.

What should I do? Connector?

EDIT: Solved the problem with System.setProperty ("java.io.tmpdir", "/ home / username /"); Apparently for some reason the native library from the tmp folder failed to execute ... Probably because it was created by root. Also I had to go back to sqlite-jdbc-3.7.2.jar because new crash on Linux.

+3


source to share





All Articles