16

We have a Java-application "app.jar" in a unix home directory with a external Sqlite Driver Library.

- myapp/app.jar
- myapp/lib/sqlite-jdbc-3.8.7.jar

Device Udoo ARM Cortex V9 simliar to Raspberry Pi.

java -version
java version "1.8.0_06
Java(TM) SE Runtime Environment (build 1.8.0_06-b23)
Java HotSpot(TM) Client VM (build 25.6-b23, mixed mode)

Try to run this application failed.

java -classpath lib/sqlite-jdbc-3.8.7.jar -jar myapp.jar

It seems that the Application cannot find the Library.

java.lang.Exception: No native library is found for os.name=Linux and os.arch=arm
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:284)
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65)

I can't find a solution until now. It is possible to copy the .jar File to the jdk/lib folder?

Edit:

Now I tried to add the sqlite-jdbc-3.7.2.jar to the JRE and it works.

 jdk1.8.0_06/jre/lib/ext

The newer version sqlite-jdbc-3.8.7.jar does not work.

EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
user3623194
  • 198
  • 1
  • 11
  • 1
    Application can find driver, but in jar there is no native driver for arm platform – Oleksandr Papchenko Oct 24 '14 at 17:45
  • 1
    As mentioned there is no arm native library. However, there is none in 3.7.2 either so don't understand how that worked. Did you get both versions from the same place. Is it possible that someone built the arm library themselves and bundled that with the library? – vickirk Apr 08 '15 at 08:06

2 Answers2

1

I compared the SQLiteJDBCLoader code in version 3.8.7 with version 3.7.2 and found some insight. 3.7.2 seems to have a pure java mode while the corresponding code is from 3.8.7 missing. From my little knowledge and a quick glance on the download page, I conclude one would need a native library for the target platform. I could not find a download for ARM.

If you need a pure java datebase, you might take another choice.

Community
  • 1
  • 1
remipod
  • 11,269
  • 1
  • 22
  • 25
1

I believe your command line is wrong. If you use -jar, then the -classpath is ignored!

Either the manifest in app.jar needs to refer to the library, or you need to start it like this: java -classpath lib/sqlite-jdbc-3.8.7.jar:myapp.jar name.of.MainClass

Angel O'Sphere
  • 2,642
  • 20
  • 18
  • This is correct, it is described in the docs here for the -jar option https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#standard-options-for-java – Kevin Hooke Jan 24 '23 at 16:33