运行Java SQLite JDBC时出现本机错误

运行Java SQLite JDBC时出现本机错误,java,sqlite,jdbc,raspberry-pi,raspbian,Java,Sqlite,Jdbc,Raspberry Pi,Raspbian,我想在Raspberry Pi vA或vB上运行Java程序。我正在使用SQLite JDBC库,它应该支持Raspi。启动.jar时,会弹出以下错误: A fatal error has been detected by the Java Runtime Environment: SIGILL (0x4) at pc=0xac507cb0, pid=5789, tid=3057054816 JRE version: Java(TM) SE Runtime Environment (8.0_

我想在Raspberry Pi vA或vB上运行Java程序。我正在使用SQLite JDBC库,它应该支持Raspi。启动.jar时,会弹出以下错误:

A fatal error has been detected by the Java Runtime Environment:

SIGILL (0x4) at pc=0xac507cb0, pid=5789, tid=3057054816

JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
Java VM: Java HotSpot(TM) Client VM (25.65-b01 mixed mode linux-arm )
Problematic frame:
C [sqlite-3.8.11.2-38a14bad-15c4-42f0-8c15-a19159eabd43-libsqlitejdbc.so+0x5cb0]

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

Stack: [0xb6320000,0xb6370000], sp=0xb636d6f0, free space=309k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [sqlite-3.8.11.2-38a14bad-15c4-42f0-8c15-a19159eabd43-libsqlitejdbc.so+0x5cb0]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+0
j java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+328
j java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+48
j java.lang.Runtime.load0(Ljava/lang/Class;Ljava/lang/String;)V+57
j java.lang.System.load(Ljava/lang/String;)V+7
j org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(Ljava/lang/String;Ljava/lang/String;)Z+29
j org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z+308
j org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary()V+224
j org.sqlite.SQLiteJDBCLoader.initialize()Z+0
j org.sqlite.core.NativeDB.load()Z+19
j org.sqlite.core.CoreConnection.open(II)V+355
j org.sqlite.core.CoreConnection.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V+138
j org.sqlite.jdbc3.JDBC3Connection.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V+4
j org.sqlite.jdbc4.JDBC4Connection.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V+4
j org.sqlite.SQLiteConnection.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V+4
j org.sqlite.JDBC.createConnection(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;+24
j org.sqlite.JDBC.connect(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;+2
j java.sql.DriverManager.getConnection(Ljava/lang/String;Ljava/util/Properties;Ljava/lang/Class;)Ljava/sql/Connection;+171
j java.sql.DriverManager.getConnection(Ljava/lang/String;)Ljava/sql/Connection;+13
顺便说一下,该代码在Windows上运行良好

我试图找到一个解决方案,但遇到了一个有一些相似之处的问题:。
他们似乎找到了解决方案,但修复库文件不再可用。这里有人能帮我吗?

对于将来有相同问题的人:例如XOWA中使用的库修复在ARMv6上不起作用,因此不支持Raspi A


如果有人需要,这里有一个补丁库(3.8.11.2)的镜像:。

XOWA开发者在这里。Github线程已经更新了最新的答案,但我只想在这里引用它,以防有人无意中发现这篇文章:

简而言之,XOWA arm包中的sqlite jdbc jar在Raspberry Pi上可以工作。kwantuM可能仍然在使用旧的sqlite jdbc jar

下面我摘录了更多内容。kwantuM或其他任何人:如果我需要添加/修改此评论,请随时通知我

谢谢



该注释包含一个似乎已过时的下载链接,但您可以尝试从更新的XOWA版本获取经过调整的SQLite JAR,如。我刚刚从XOWA尝试了JAR,给出了相同的错误。此错误是由ARMv6引起的,请参阅我的注释。GitHub解决方案是解决不满意的链接错误的解决方案,该错误通过使用补丁库来解决。Ok。我没有意识到它在Raspi A上不起作用。感谢您的澄清。这对任何遇到相同错误的人仍然有用。
I built a simple sample project to test yonisolos patch to get sqlite-jdbc working on Raspberry Pi.

Here were my steps to build the project:
* Used the sqlite-jdbc-3.8.11.2.jar in at /xowa/bin/any/java/jdbc/sqlite/sqlite-jdbc-3.8.11.2.jar 
* Built a Java project called piSqlite in Eclipse.
* Added sqlite-jdbc-3.8.11.2.jar to the Build Path
* Wrote sample code to create and insert into a SQLite database. See the source code at the bottom of this comment.
* Compiled the Java project into a jar file
* Also, all three files are available here: https://mega.nz/#fm/q55wDRTR

Here were my steps to test the project:
* Copied the piSqlite.jar to my "Raspberry Pi 2 Model B 1GB" device
* Opened up Terminal and ran the following <code>java -jar piSqlite.jar</code>. I got the following output:
```
No connection string specified. Using default of 'jdbc:sqlite:test.db'
Successfully opened database: jdbc:sqlite:test.db
Successfully created table called 'test_table'
Successfully inserted record into 'test_table'
Successfully selected data; test_id=1; test_string=abcde
Successfully closed connection. Exiting...
```