我正在使用Java 11,使用Hibernate和H2数据库开发JavaFX应用程序,所有依赖项都使用IntelliJ Idea 2019.1.4通过Gradle 5.6.2导入。

尽管该库是导入部分,但未检测到H2自动模块名称com.h2database

我的build.gradle文件:

plugins {     id 'java'     id 'application'     id 'org.openjfx.javafxplugin' version '0.0.8' }  group 'org.sarc' version '1.0-SNAPSHOT'  sourceCompatibility = 11  javafx {     version = "11"     modules = [ 'javafx.controls','javafx.fxml' ] }  repositories {     mavenCentral() }  dependencies { // https://mvnrepository.com/artifact/org.hibernate/hibernate-core     compile group: 'org.hibernate', name: 'hibernate-core', version: '5.4.8.Final' // https://mvnrepository.com/artifact/com.h2database/h2     testCompile group: 'com.h2database', name: 'h2', version: '1.4.200'  } 

还有我的module-info.java文件:

module vtcc {     requires java.sql;     requires javafx.controls;     requires javafx.fxml;     requires org.hibernate.orm.core;     requires java.persistence;     requires com.h2database; } 

现在,最后一个要求intelliJ告诉我module is not in dependencies

===============>>#1 票数:0

切换到SQLite,完美运行

  ask by Ossama Nasser translate from so

本文未有回复,本站智能推荐: