diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01d093139..9b1e796a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: - '**.java' - '**.xml' - '**.so' - - '**.jnilib' + - '**.dylib' - '**.dll' - '.github/workflows/*.yml' push: @@ -22,7 +22,7 @@ on: - '**.java' - '**.xml' - '**.so' - - '**.jnilib' + - '**.dylib' - '**.dll' - '.github/workflows/*.yml' diff --git a/Makefile b/Makefile index fa41c4492..fff1841dc 100644 --- a/Makefile +++ b/Makefile @@ -202,10 +202,10 @@ sparcv9: $(MAKE) native OS_NAME=SunOS OS_ARCH=sparcv9 mac64-signed: mac64 - $(CODESIGN) src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib + $(CODESIGN) src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.dylib mac-arm64-signed: mac-arm64 - $(CODESIGN) src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib + $(CODESIGN) src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.dylib package: native-all rm -rf target/dependency-maven-plugin-markers diff --git a/Makefile.common b/Makefile.common index cbf450914..f1e260d08 100644 --- a/Makefile.common +++ b/Makefile.common @@ -183,7 +183,7 @@ Mac-x86_CC := gcc Mac-x86_STRIP := strip -x Mac-x86_CCFLAGS := -I$(JAVA_HOME)/include -Ilib/inc_mac -Os -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden Mac-x86_LINKFLAGS := -dynamiclib -Mac-x86_LIBNAME := libsqlitejdbc.jnilib +Mac-x86_LIBNAME := libsqlitejdbc.dylib Mac-x86_SQLITE_FLAGS := -DSQLITE_ENABLE_LOCKING_STYLE=0 HPUX-ia64_32_CC := cc @@ -201,7 +201,7 @@ ifeq ($(wildcard MAC_SDK),) endif Mac-x86_64_CCFLAGS := -I$(MAC_SDK)/System/Library/Frameworks/JavaVM.framework/Headers -Ilib/inc_mac -Os -fPIC -mmacosx-version-min=10.6 -fvisibility=hidden -Wno-implicit-function-declaration Mac-x86_64_LINKFLAGS := -dynamiclib -Mac-x86_64_LIBNAME := libsqlitejdbc.jnilib +Mac-x86_64_LIBNAME := libsqlitejdbc.dylib Mac-x86_64_SQLITE_FLAGS := # Use a CROSS_PREFIX as the cross-triple clang is not available in crossbuild, see https://github.com/multiarch/crossbuild/blob/ad79cc84b6fb3fb1d09bc4a78719ef26f23bab85/Dockerfile#L134 @@ -211,7 +211,7 @@ Mac-aarch64_STRIP := $(CROSS_PREFIX)strip -x MAC_SDK := /usr/osxcross/SDK/MacOSX11.3.sdk Mac-aarch64_CCFLAGS := -I$(MAC_SDK)/System/Library/Frameworks/JavaVM.framework/Headers -Ilib/inc_mac -Os -fPIC -mmacosx-version-min=10.9 -fvisibility=hidden -Wno-implicit-function-declaration Mac-aarch64_LINKFLAGS := -dynamiclib -Mac-aarch64_LIBNAME := libsqlitejdbc.jnilib +Mac-aarch64_LIBNAME := libsqlitejdbc.dylib Mac-aarch64_SQLITE_FLAGS := Windows-x86_CC := $(CROSS_PREFIX)gcc diff --git a/README.adoc b/README.adoc index 4f3f70580..eb07c266f 100644 --- a/README.adoc +++ b/README.adoc @@ -98,7 +98,7 @@ id = 2 == How does SQLiteJDBC work? Our SQLite JDBC driver package (i.e., `sqlite-jdbc-{project-version}.jar`) contains three -types of native SQLite libraries (`sqlitejdbc.dll`, `sqlitejdbc.jnilib`, `sqlitejdbc.so`), +types of native SQLite libraries (`sqlitejdbc.dll`, `sqlitejdbc.dylib`, `sqlitejdbc.so`), each of them is compiled for Windows, macOS and Linux. An appropriate native library file is automatically extracted into your OS's temporary folder, when your program loads `org.sqlite.JDBC` driver. diff --git a/SQLiteJDBC.wiki b/SQLiteJDBC.wiki index fa5690eea..d671c1ec6 100644 --- a/SQLiteJDBC.wiki +++ b/SQLiteJDBC.wiki @@ -10,7 +10,7 @@ Our SQLiteJDBC library, developed as a part of [http://www.xerial.org Xerial pro The original Zentus's SQLite JDBC driver http://www.zentus.com/sqlitejdbc/ itself is an excellent utility for using [https://www.sqlite.org SQLite] databases from Java language, and our SQLiteJDBC library also relies on its implementation. However, its pure-java version, which totally translates c/c++ codes of SQLite into Java, is significantly slower compared to its native version, which uses SQLite binaries compiled for each OS (win, mac, linux). -To use the native version of sqlite-jdbc, user had to set a path to the native codes (dll, jnilib, so files, which are JNDI C programs) by using command-line arguments, e.g., -Djava.library.path=(path to the dll, jnilib, etc.), or -Dorg.sqlite.lib.path, etc. This process was error-prone and bothersome to tell every user to set these variables. Our SQLiteJDBC library completely does away these inconveniences. +To use the native version of sqlite-jdbc, user had to set a path to the native codes (dll, dylib, so files, which are JNDI C programs) by using command-line arguments, e.g., -Djava.library.path=(path to the dll, dylib, etc.), or -Dorg.sqlite.lib.path, etc. This process was error-prone and bothersome to tell every user to set these variables. Our SQLiteJDBC library completely does away these inconveniences. Another difference is that we are keeping this SQLiteJDBC libray up-to-date to the newest version of SQLite engine, because we are one of the hottest users of this library. For example, SQLite JDBC is a core component of [http://utgenome.org/ UTGB (University of Tokyo Genome Browser) Toolkit], which is our utility to create personalized genome browsers. @@ -254,7 +254,7 @@ Another sample code is [http://code.google.com/p/xerial/source/browse/src/test/j == How does SQLiteJDBC work? == -Our SQLite JDBC driver package (i.e., sqlite-jdbc-(VERSION).jar) contains three types of native SQLite libraries (sqlite-jdbc.dll, sqlite-jdbc.jnilib, sqlite-jdbc.so), each of them is compiled for Windows, Mac OS and Linux. An appropriate native library file is automatically extracted into your OS's temporary folder, when your program loads "org.sqlite.JDBC" driver. +Our SQLite JDBC driver package (i.e., sqlite-jdbc-(VERSION).jar) contains three types of native SQLite libraries (sqlite-jdbc.dll, sqlite-jdbc.dylib, sqlite-jdbc.so), each of them is compiled for Windows, Mac OS and Linux. An appropriate native library file is automatically extracted into your OS's temporary folder, when your program loads "org.sqlite.JDBC" driver. == Source Codes == * Mercurial Repository: http://code.google.com/p/xerial/source/checkout?repo=sqlite @@ -308,7 +308,7 @@ If you are familier with [http://maven.apache.org Maven2], add the following XML == Using SQLiteJDBC with Tomcat6 Web Server == Do not include sqlite-jdbc-(version).jar in WEB-INF/lib folder of your web application package, since multiple web applications hosted by the same Tomcat server cannot load the sqlite-jdbc native library more than once. That is the specification of JNI (Java Native Interface). You will observe UnsatisfiedLinkError exception with the message "no SQLite library found". -Work-around of this problem is to put sqlite-jdbc-(version).jar file into (TOMCAT_HOME)/lib direcotry, in which multiple web applications can share the same native library file (.dll, .jnilib, .so) extracted from this sqlite-jdbc jar file. +Work-around of this problem is to put sqlite-jdbc-(version).jar file into (TOMCAT_HOME)/lib directory, in which multiple web applications can share the same native library file (.dll, .dylib, .so) extracted from this sqlite-jdbc jar file. If you are using Maven for your web application, set the dependency scope as 'provided', and manually put the SQLite JDBC jar file into (TOMCAT_HOME)/lib folder. {{{ @@ -360,9 +360,9 @@ export PATH=$MAVEN_HOME/bin:$PATH * Mac OS X (10.4.10 Tiger ~ 10.5 Leopard) * dependency check {{{ -> otool -L libsqlitejdbc.jnilib -libsqlitejdbc.jnilib: - build/Darwin-i386/libsqlitejdbc.jnilib (compatibility version 0.0.0, current version 0.0.0) +> otool -L libsqlitejdbc.dylib +libsqlitejdbc.dylib: + build/Darwin-i386/libsqlitejdbc.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) }}} * Linux (glibc-2.5.12) diff --git a/src/main/java/org/sqlite/SQLiteJDBCLoader.java b/src/main/java/org/sqlite/SQLiteJDBCLoader.java index 7055ed341..9f64d6f64 100644 --- a/src/main/java/org/sqlite/SQLiteJDBCLoader.java +++ b/src/main/java/org/sqlite/SQLiteJDBCLoader.java @@ -45,7 +45,7 @@ /** * Set the system properties, org.sqlite.lib.path, org.sqlite.lib.name, appropriately so that the - * SQLite JDBC driver can find *.dll, *.jnilib and *.so files, according to the current OS (win, + * SQLite JDBC driver can find *.dll, *.dylib and *.so files, according to the current OS (win, * linux, mac). * *

The library files are automatically extracted from this project's package (JAR). diff --git a/src/main/java/org/sqlite/util/LibraryLoaderUtil.java b/src/main/java/org/sqlite/util/LibraryLoaderUtil.java index aad845733..3eb27325b 100644 --- a/src/main/java/org/sqlite/util/LibraryLoaderUtil.java +++ b/src/main/java/org/sqlite/util/LibraryLoaderUtil.java @@ -15,11 +15,7 @@ public static String getNativeLibResourcePath() { /** Get the OS-specific name of the sqlitejdbc native library. */ public static String getNativeLibName() { - String nativeLibName = System.mapLibraryName("sqlitejdbc"); - if (nativeLibName != null && nativeLibName.endsWith(".dylib")) { - nativeLibName = nativeLibName.replace(".dylib", ".jnilib"); - } - return nativeLibName; + return System.mapLibraryName("sqlitejdbc"); } public static boolean hasNativeLib(String path, String libraryName) { diff --git a/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib b/src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.dylib old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.jnilib rename to src/main/resources/org/sqlite/native/Mac/aarch64/libsqlitejdbc.dylib diff --git a/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib b/src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.dylib old mode 100755 new mode 100644 similarity index 100% rename from src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib rename to src/main/resources/org/sqlite/native/Mac/x86_64/libsqlitejdbc.dylib