我是 Hibernate 的新手。我遇到了这样的问题:虽然我配置了 Hibernate 和 MySQL 的所有必需的 JARS,但当我尝试导入 SessionFactory 时,它 仍然显示这样的错误信息:
The package org.hibernate is accessible from more than one module: hibernate.commons.annotations, hibernate.core
有人知道怎么解决吗?
最佳答案
我认为问题出在 java 9 和模块的新介绍上。尝试将您的执行环境更改为 java 8,如果这不起作用,请尝试在类路径而不是模块路径中引用您的 Hibernate jar 文件。在项目的构建路径中配置它
关于java - 包 org.hibernate 可以从多个模块访问 : hibernate. commons.annotations, hibernate.core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50173740/