Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No native library found for darwin aarch64 #562

Closed
felipecsl opened this issue Dec 8, 2020 · 7 comments
Closed

No native library found for darwin aarch64 #562

felipecsl opened this issue Dec 8, 2020 · 7 comments

Comments

@felipecsl
Copy link

Failed on new Apple silicon laptops (M1/arm64)

Caused by: java.sql.SQLException: Error opening connection
	at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:239) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.JDBC.createConnection(JDBC.java:115) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.SQLiteDataSource.getConnection(SQLiteDataSource.java:410) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.SQLiteDataSource.getConnection(SQLiteDataSource.java:398) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.jobrunr.storage.sql.common.SqlStorageProviderFactory.getStorageProviderUsingDataSource(SqlStorageProviderFactory.java:25) ~[jobrunr-1.2.0.jar:na]
	... 45 common frames omitted
Caused by: java.lang.Exception: No native library found for os.name=Mac, os.arch=aarch64, paths=[/Users/felipelima/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
	at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:367) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:67) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.core.NativeDB.load(NativeDB.java:63) ~[sqlite-jdbc-3.32.3.2.jar:na]
	at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:235) ~[sqlite-jdbc-3.32.3.2.jar:na]
	... 52 common frames omitted
@felipecsl
Copy link
Author

Just saw #558
would yall be able to cut a new release with that change, please?
Thanks!

@felipecsl
Copy link
Author

As a workaround, downloading libsqlitejdbc.jnilib and placing it in ~/Library/Java/Extensions fixes it

@xerial
Copy link
Owner

xerial commented Dec 8, 2020

Just released 3.32.3.3 with M1 support :)

@felipecsl
Copy link
Author

Worked :) thanks!

@supervate
Copy link

As a workaround, downloading libsqlitejdbc.jnilib and placing it in ~/Library/Java/Extensions fixes it

it can resolve the problem that I can't open my plugin in idea(using sqllite)?
I put this file to the target directory, but I don't know how it works,and I still can't using the plugin in my idea.

@jzherran
Copy link

jzherran commented Apr 1, 2022

Hey folks, I have the same issue I can't use the latest version of the xerial/sqlite0jdbc because broke some communication related to the kernel that I used to connect.

But when I add the library in the folder as referred @felipecsl I received the following error:

Syntax error (ClassNotFoundException) compiling at (/private/var/folders/kz/rjmcjggd5tscjxcjktp6z4sc0000gn/T/form-init9543403292769450227.clj:1:125).
org.sqlite.Collation

Do you know maybe what is the error?

@Bernhard-Steindl
Copy link

Bernhard-Steindl commented Oct 31, 2022

Do you know maybe what is the error?

Hello @jzherran,
I noticed the same error as you: Exception in thread "main" java.lang.NoClassDefFoundError: org/sqlite/Collation.
Because felipecsl pointed to the file libsqlitejdbc.jnilib in the master branch at the time of his comment on 8 Dec 2020.

I figured out that the libsqlitejdbc.jnilib file was added to the folder /org/sqlite/native/Mac/aarch64/ in Tag 3.32.3.3 around 28 Nov 2020.
Apparently, this file has been changed since its creation, referencing now a class in org/sqlite/Collation which was added just recently on Aug 16, 2022 and thus is not available in older builds of sqlite-jdbc.

I managed to download libsqlitejdbc.jnilib when it was added for Mac/aarch64, extracted my out-dated sqlite-jdbc jar of version 3.30.1, put the libsqlitejdbc.jnilib into the folder /org/sqlite/native/Mac/aarch64/ and re-built the jar file with jar cvf sqlite-jdbc-3.30.1.jar . when staying in the folder which contains the org directory.

Why? I am using an application that has fixed the dependency for the sqlite-jdbc-3.30.1.jar file and I wanted to make it run as a workaround without making big changes.

BR Bernhard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants