UnsatisfiedLinkError with sqlite4java Jar on Mac OS X NetBeans

前端 未结 4 1988
悲哀的现实
悲哀的现实 2020-12-11 08:49

I am getting experiencing a similar problem to this question:

UnsatisfiedLinkError with sqlite4java Jar on Mac OS X

However, I am running on a Mac, and I hav

相关标签:
4条回答
  • 2020-12-11 09:05

    Not sure what exactly is the problem, but you can try running sqlite4java's diagnostics code from within your program and see if it shows the same loading sequence:

    public Database() {
        com.almworks.sqlite4java.SQLite.main(new String[] {"-d"});
        db = new SQLiteConnection(new File("./test.db"));
        ...
    
    0 讨论(0)
  • 2020-12-11 09:13

    I had the same error for my program after upgrade to Mountain Lion. When I added the libraries to /Libraries/Java/Extensions he program run fine. I don't know if this the best solution, but it worked.

    0 讨论(0)
  • 2020-12-11 09:23

    This is the solution of :

    Exception in thread "main" com.almworks.sqlite4java.SQLiteException:
    [-91]cannot load library: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64
    in java.library.path
    

    Please try running this:

     java -jar sqlite4java.jar -d
    

    to make it try to load all variants of the binary and verify the results.

    the result must be like this:

    java -jar sqlite4java.jar -d
    sqlite4java 282
    121212:134119.239 FINE [sqlite] Internal: loading library
    121212:134119.239 FINE [sqlite] Internal:java.library.path=/Users/XXXXX/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
    121212:134119.240 FINE [sqlite] Internal: sqlite4java.library.path=null
    121212:134119.240 FINE [sqlite] Internal: cwd=XXXXX
    121212:134119.240 FINE [sqlite] Internal: default path=XXXXX
    121212:134119.240 FINE [sqlite] Internal: forced path=null 
    121212:134119.240 FINE [sqlite] Internal: os.name=mac os x; os=osx
    121212:134119.240 FINE [sqlite] Internal: os.arch=x86_64
    121212:134119.240 FINE [sqlite] Internal: trying to load sqlite4java-osx-x86_64
    121212:134119.243 FINE [sqlite] Internal: cannot load sqlite4java-osx-x86_64: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64 in java.library.path
    121212:134119.243 FINE [sqlite] Internal: trying to load sqlite4java-osx-amd64
    121212:134119.244 FINE [sqlite] Internal: cannot load sqlite4java-osx-amd64:         java.lang.UnsatisfiedLinkError: no sqlite4java-osx-amd64 in java.library.path
    121212:134119.244 FINE [sqlite] Internal: trying to load sqlite4java-osx-10.4
    121212:134119.249 INFO [sqlite] Internal: loaded sqlite4java-osx-10.4 from system path
    121212:134119.252 INFO [sqlite] Internal: loaded sqlite 3.7.10, wrapper 0.2
    SQLite 3.7.10
    Compile-time options: ENABLE_COLUMN_METADATA ENABLE_FTS3 ENABLE_FTS3_PARENTHESIS     ENABLE_LOCKING_STYLE=0 ENABLE_MEMORY_MANAGEMENT ENABLE_RTREE OMIT_DEPRECATED TEMP_STORE=1    THREADSAFE=1
    

    The files are tried in the order of more specific to less specific. So the order is correct.

    The problem is that there's no more specific binary -so we might need to rename libsqlite4java-osx.jnilib to libsqlite4java-osx-amd64.dylib.

    0 讨论(0)
  • 2020-12-11 09:30

    I had the same problem, but managed to get it to load sqlite by creating the libs folder from the IDE and then copying the jar into the new libs folder. Then I removed the old version of the jar from the build path and added in the new one. Hope this helps!

    0 讨论(0)
提交回复
热议问题