简体   繁体   中英

Module waffle.jna not found, required by org.mariadb.jdbc

I doing my first JDBC project with javaFX

module com.example.obs {
    requires javafx.controls;
    requires javafx.fxml;

    requires org.controlsfx.controls;
    requires org.kordamp.bootstrapfx.core;
    requires javafx.graphics;
    requires java.sql;
    requires org.mariadb.jdbc;

    opens com.example.obs to javafx.fxml;
    exports com.example.obs;

}

I'm getting this excaption

java: java.lang.reflect.InvocationTargetException
Module waffle.jna not found, required by org.mariadb.jdbc

You get this error because the MariaDB JDBC driver has a dependency on the Waffle JNA (Java Native Access) library.

To get rid of this error you need add the waffle.jna library to your module-info.java file:

requires waffle.jna

Or include the library to your pom.xml if you are using Maven

<dependency>
    <groupId>com.github.waffle</groupId>
    <artifactId>waffle-jna</artifactId>
    <version>3.2.0</version>
</dependency>

If you're using Gradle add it to your build.gradle

dependencies {
  implementation group: 'com.github.waffle', name: 'waffle-jna', version: '3.2.0'
}

If you're using java eclipse u can add it to the .classpath file

<classpathentry kind="lib" path="/path/to/waffle-jna-3.2.0.jar"/>

You can download the jar file here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM