0

First, apologies if this should actually go in Software Engineering. I'm not entirely sure where to put this.

Background: I'm building a Java game that I want to be able to run on any system that runs Java. However, the game needs to talk to an SQLite database.

As far as I'm aware, all of the drivers that allow Java to talk to SQLite are device specific, and some devices are not supported by SQLite drivers, such as the Apple M1 processor.

(Apparently there is some kind of workaround for this one (Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64), but I don't understand most of the steps involved as I am unfamiliar with Kapt, Room, and Graydle)

So my question is, how can I create an install script that will automatically ensure this dependency is fulfilled when the player runs the game? (regardless of the player's OS)

The only thing I could think of was to download the source code for the SQLite driver (from https://www.sqlite.org/download.html) and compile it locally on the user's machine. But it doesn't seem to come with a makefile (and maybe not everyone will have C installed?)

Any help would be appreciated. (Including a link to download the SQLite aarch .jar file).

Benjy Strauss
  • 99
  • 1
  • 5
  • 2
    Why SqlLite and not a Java embedded database that will run everywhere Java runs? – g00se Jun 05 '23 at 08:14
  • 1
    There is extensive documentation for the Xerial SQLite JDBC driver on how to build the driver including native SQLite: https://github.com/xerial/sqlite-jdbc/blob/master/CONTRIBUTING.md. – vanje Jun 05 '23 at 09:36
  • Using SQLite because I had never heard of a Java embedded database. I will look into it. Thanks for the link. – Benjy Strauss Jun 06 '23 at 23:18
  • 1
    Well SqlLite is usually used as an embedded/local database. You might be better off using one that is pure Java and therefore fully portable. H2, Derby etc. – g00se Jun 06 '23 at 23:19
  • Any ideas of where I could get a free editor for an H2 or Derby database? (I was using SQLite because it came with Valentina Studio, which was my database editor) – Benjy Strauss Jun 06 '23 at 23:27
  • 1
    I generally use command line tools, but [this](http://www.squirrelsql.org/#overview) might be of interest – g00se Jun 06 '23 at 23:47

0 Answers0