zouzg / mybatis-generator-gui

mybatis-generator界面工具,让你生成代码更简单更快捷
6.68k stars 2.53k forks source link

mac m1. can't start the program. No native library is found for os.name=Mac and os.arch=aarch64 #329

Open leonf-tech opened 2 years ago

leonf-tech commented 2 years ago

java 11 mac OS 12.3.1 javafx : 18.0.1

已经手动导入 sqlite3 library sqlite : v3.7.2

报错信息 [INFO] [14:10:48.684] [JavaFX Application Thread] [] com.zzg.mybatis.generator.util.ConnectionManager.getConnection:20 --> database FilePath :/Users/xxx/FL_Documents/Codes/mybatis-generator-gui-master/./config/sqlite3.db [ERROR] [14:10:48.700] [JavaFX Application Thread] [] com.zzg.mybatis.generator.controller.MainUIController.loadLeftDBTree:296 --> connect db failed, reason java.sql.SQLException: Error opening connection at org.sqlite.core.CoreConnection.open(CoreConnection.java:215) at org.sqlite.core.CoreConnection.(CoreConnection.java:76) at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:24) at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:23) at org.sqlite.SQLiteConnection.(SQLiteConnection.java:45) at org.sqlite.JDBC.createConnection(JDBC.java:114) at org.sqlite.JDBC.connect(JDBC.java:88) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:251) at com.zzg.mybatis.generator.util.ConnectionManager.getConnection(ConnectionManager.java:21) at com.zzg.mybatis.generator.util.ConfigHelper.loadDatabaseConfig(ConfigHelper.java:68) at com.zzg.mybatis.generator.controller.MainUIController.loadLeftDBTree(MainUIController.java:284) at com.zzg.mybatis.generator.controller.MainUIController.initialize(MainUIController.java:213) at javafx.fxml@18.0.1/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2655) at javafx.fxml@18.0.1/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548) at javafx.fxml@18.0.1/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516) at com.zzg.mybatis.generator.MainUI.start(MainUI.java:30) at javafx.graphics@18.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847) at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484) at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456) at javafx.graphics@18.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64 at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:284) at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65) at org.sqlite.core.NativeDB.load(NativeDB.java:53) at org.sqlite.core.CoreConnection.open(CoreConnection.java:211) ... 22 common frames omitted

程序错误截图

image
leonf-tech commented 2 years ago

我删除 pom.xml 里面的 sqlite 依赖。才能让我手动导入的 sqlite3 以来生效。生效以后 就好了 注意: 数据库类型要选择 mysql8

xuningnh commented 5 months ago

我删除 pom.xml 里面的 sqlite 依赖。才能让我手动导入的 sqlite3 以来生效。生效以后 就好了 注意: 数据库类型要选择 mysql8

具体说一下什么手动导入?从中央仓库下载jar包然后导进项目里吗? 我也这么做了,还按上面说的把pom依赖的sqlite-jdbc注释掉还是不生效