我已将一些 Apache Spark 依赖项添加到我的 JavaFX 项目中,但现在它已损坏。
Java SDK 11
依赖关系:
我已经在 module-info.java 中声明了它们(使用 Automatic-Module-Name 属性编辑了 MANIFEST 文件)
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] the unnamed module reads package org.apache.spark.unused from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.util from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.streaming from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.internal from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sql and org.apache.spark.sqlapi
[ERROR] the unnamed module reads package org.apache.spark.unused from both org.apache.spark.sql and org.apache.spark.commonutils
[ERROR] the unnamed module reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.sql and org.apache.spark.commonutils
[ERROR] the unnamed module reads package org.apache.spark.api.java.function from both org.apache.spark.sqlapi and org.apache.spark.commonutils
[ERROR] module org.apache.spark.sql reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sql reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sql reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sql reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module ojdbc10 reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module ojdbc10 reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module ojdbc10 reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module ojdbc10 reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.json reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.json reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.json reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.json reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module itextpdf reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module itextpdf reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module itextpdf reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module itextpdf reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module EUSignJava reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module EUSignJava reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module EUSignJava reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module EUSignJava reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.commons.lang3 reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.util from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.internal from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.execution.streaming from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.catalyst.plans.logical from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module com.fasterxml.jackson.databind reads package org.apache.spark.sql.catalyst.analysis from both org.apache.spark.sqlapi and org.apache.spark.sql
[ERROR] module org.apache.spark.sqlapi reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sqlapi reads package org.apache.spark.sql.catalyst.util from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sqlapi reads package org.apache.spark.api.java.function from both org.apache.spark.commonutils and org.apache.spark.sqlapi
[ERROR] module org.apache.spark.sqlapi reads package org.apache.spark.unused from both org.apache.spark.commonutils and org.apache.spark.sql
[INFO] 100 errors
[INFO] -------------------------------------------------------------
如何在运行和构建应用程序时解决这些问题?
有关类似错误的相关问题中的一些信息:
尽管您生成此错误的确切原因将与该答案中提到的原因不同。
无论你在这样做时做什么都是错误的:
在
中声明它们(使用module-info.java
属性编辑 MANIFEST 文件)Automatic-Module-Name
使用非模块化软件时最简单的解决方案是使应用程序成为非模块化的。
module-info.java
。非模块化 JavaFX 应用程序的说明位于 openjfx.io 的入门说明中。
我还建议使用现代 Java 和 JavaFX 版本(例如 21+)以及与您的 IDE 项目同步的构建工具(Maven 或 Gradle)。