无法使用 Apache Spark 依赖项构建 JavaFX 应用程序

问题描述 投票:0回答:1

我已将一些 Apache Spark 依赖项添加到我的 JavaFX 项目中,但现在它已损坏。
Java SDK 11
依赖关系:

  • spark-sql_2.13 (3.5.0)
  • spark-core_2.13 (3.5.0)
  • univocity 解析器 (2.9.1)

我已经在 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] -------------------------------------------------------------

如何在运行和构建应用程序时解决这些问题?

java apache-spark javafx apache-spark-sql javafx-11
1个回答
0
投票

有关类似错误的相关问题中的一些信息:

尽管您生成此错误的确切原因将与该答案中提到的原因不同。

无论你在这样做时做什么都是错误的:

module-info.java
中声明它们(使用
Automatic-Module-Name
属性编辑 MANIFEST 文件)

使用非模块化软件时最简单的解决方案是使应用程序成为非模块化的。

  1. 删除您的
    module-info.java
  2. 将 JavaFX 放在模块路径上:
    • 使用编译器开关和 VM 参数将 JavaFX 放在模块路径上
    • 或者,使用包含 JavaFX 模块的 JRE,例如 BellSoft Full JDK。

非模块化 JavaFX 应用程序的说明位于 openjfx.io 的入门说明中。

我还建议使用现代 Java 和 JavaFX 版本(例如 21+)以及与您的 IDE 项目同步的构建工具(Maven 或 Gradle)。

© www.soinside.com 2019 - 2024. All rights reserved.