Can't ue sqlite4java since upgrading to OS 10.9

325 views
Skip to first unread message

Will Herrmann

unread,
Feb 9, 2014, 4:49:09 PM2/9/14
to sqlit...@googlegroups.com
I recently upgraded from OS 10.7 to 10.9 and since then I'm unable to get sqlite4java to work. Whenever I run my project in Eclipse, I get the following:

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

The thing is, that file is in exactly the same place that it was before I upgraded; sqlite4java-osx-x86_64.jnilib is in the same directory as sqlite4java.jar, which is in my build classpath. I noticed there is an issue for Support for OS X 10.9, which unfortunately has not been resolved.

Please let me know what needs to be done to resolve this problem. I need to be able to have my sqlite4java application run in OS X 10.9.

Igor Sereda

unread,
Feb 10, 2014, 6:25:44 AM2/10/14
to sqlit...@googlegroups.com
Hello Will,

Please check that you have upgraded your Java package on Mavericks. I’m testing on OS X 10.9.1 and sqlite4java build 282 successfully loads libsqlite4java-osx.jnilib and libsqlite4java-osx-10.4.jnilib from distribution. I’m testing with both Java 1.7.0_45 and 1.6.0_65.

If Java upgrade does not help, please provide more info:
  1. Download sqlite4java-282.zip from sqlite4java homepage.
  2. Unzip it somewhere
  3. Run java -jar sqlite4java.jar -d
  4. Run java -version
Please post the results here.

Cheers,
Igor




--
You received this message because you are subscribed to the Google Groups "sqlite4java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlite4java...@googlegroups.com.
To post to this group, send email to sqlit...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlite4java.
For more options, visit https://groups.google.com/groups/opt_out.

Will Herrmann

unread,
Feb 10, 2014, 10:33:31 PM2/10/14
to sqlit...@googlegroups.com, ser...@almworks.com
I unzipped Sqlite4java, but you didn't say if I needed to put it anywhere. Here is what I get:

java -jar sqlite4java.jar -d
Error: Unable to access jarfile sqlite4java.jar

java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

Will Herrmann

unread,
Feb 10, 2014, 10:37:50 PM2/10/14
to sqlit...@googlegroups.com, ser...@almworks.com
It suddenly occurred to me that I needed to change to the directory with the Sqlite4java in the Terminal before I could run the first command. Here are the results after doing that:

java -jar sqlite4java.jar -d
sqlite4java 282
140210:213401.646 FINE [sqlite] Internal: loading library
140210:213401.663 FINE [sqlite] Internal: java.library.path=/Users/Will/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
140210:213401.664 FINE [sqlite] Internal: sqlite4java.library.path=null
140210:213401.664 FINE [sqlite] Internal: cwd=/Users/Will/Documents/Eclipse Workspace/Dependencies/sqlite4java-282/.
140210:213401.664 FINE [sqlite] Internal: default path=/Users/Will/Documents/Eclipse Workspace/Dependencies/sqlite4java-282
140210:213401.664 FINE [sqlite] Internal: forced path=null
140210:213401.664 FINE [sqlite] Internal: os.name=mac os x; os=osx
140210:213401.665 FINE [sqlite] Internal: os.arch=x86_64
140210:213401.666 FINE [sqlite] Internal: trying to load sqlite4java-osx-x86_64
140210:213401.667 FINE [sqlite] Internal: cannot load sqlite4java-osx-x86_64: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64 in java.library.path
140210:213401.667 FINE [sqlite] Internal: trying to load sqlite4java-osx-amd64
140210:213401.669 FINE [sqlite] Internal: cannot load sqlite4java-osx-amd64: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-amd64 in java.library.path
140210:213401.669 FINE [sqlite] Internal: trying to load sqlite4java-osx-10.4
140210:213401.723 INFO [sqlite] Internal: loaded sqlite4java-osx-10.4 from system path
140210:213401.736 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


I notice that it is trying to load some files that are not in the directory. The ones I have for OS X are:
  • libsqlite4java-osx-10.4.jnilib
  • libsqlite4java-osx-ppc.jnilib
  • libsqlite4java-osx.jnilib
-Will Herrmann

Igor Sereda

unread,
Feb 12, 2014, 9:05:43 AM2/12/14
to sqlit...@googlegroups.com

Hi Will,

 

Well, it seems to me that everything works. You need to debug your application and library paths. Check out if java.library.path contains the folder where you have the binary.

 

Cheers,

Igor

 

--

Igor Sereda

ALM Works

Will Herrmann

unread,
Feb 12, 2014, 9:49:07 PM2/12/14
to sqlit...@googlegroups.com, ser...@almworks.com
Well, my Java build path does contain the jar file in the same folder with the .jnlibs. Is that what you're referring to? I can't see anything wrong with how that is set up.

Thanks,
-Will Herrmann

Will Herrmann

unread,
Feb 21, 2014, 9:12:46 PM2/21/14
to sqlit...@googlegroups.com, ser...@almworks.com
I'm still having trouble with this, so I figured I would provide more information. As you can see from the attached screenshots, my Java build path points to a sqlite4java folder, which does include all of the .jnlib files in it. This setup worked just fine while I was on OS 10.7, but the day that I upgraded to OS 10.9, I could no longer run sqlite4java within Eclipse.

Any help you could provide would be greatly appreciated!

-Will Herrmann

Igor Sereda

unread,
Feb 22, 2014, 2:50:56 PM2/22/14
to sqlit...@googlegroups.com

Will, the build path is the classpath that is used during compilation. What you need is the library path that can be used by sqlite4java during runtime to find the binary libs. By default, it tries to look for them in the same directory where sqlite4java.jar is located – but probably this is overridden by java.library.path property. I’d advise you to try specifying java.library.path that includes the path where sqlite4java is located. (Using -Djava.library.path=... command line option or your IDE settings.)

 

See also: http://stackoverflow.com/questions/15559551/unsatisfiedlinkerror-with-sqlite4java-jar-on-mac-os-x-netbeans

 

Hope this helps!
Igor

Will Herrmann

unread,
Feb 22, 2014, 11:26:04 PM2/22/14
to sqlit...@googlegroups.com, ser...@almworks.com
Hi Igor,

In Eclipse, I went to my main class, then selected "Run Configurations" and added the following argument:

-Djava.library.path="/Users/Will/Documents/Eclipse Workspace/Dependencies/sqlite4java-282"

However, this resulted in Eclipse giving me the following error:

The container 'JRE System Library [Java SE 7 (MacOS X Default)]' references non existing library '/Library/Java/Extensions/sqlite4java.jar'

The only solution from the Stack Overflow question you pointed to that worked for me was this one, which said to put the files in /Library/Java/Extensions. Once I did that, Eclipse could use the libraries. This is very convenient, but I'm guessing that there is a better solution.

I think that there should be extra instructions on the home page about how to set up an IDE to use sqlite4java. Once we figure out the proper way to do it, I'd be happy to write them for Eclipse.

Thanks,
-Will Herrmann

Will Herrmann

unread,
Feb 22, 2014, 11:28:30 PM2/22/14
to sqlit...@googlegroups.com, ser...@almworks.com
My mistake, the Eclipse error happened because I moved the libraries out while I was running Eclipse. If I move them out while Eclipse is not loaded, and then add the argument I gave, I get the following error when I run my app:

com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: no sqlite4java-osx-x86_64 in java.library.path
SQLite error when trying to access database:
com.almworks.sqlite4java.SQLiteException: [-92] DB[1] is not confined or already disposed
    at com.almworks.sqlite4java.SQLiteConnection.checkThread(SQLiteConnection.java:1386)

-Will Herrmann
Reply all
Reply to author
Forward
0 new messages