I have added some Apache Spark dependencies to my JavaFX project, and now its broken.
Java SDK 11
Dependencies:
I have declared them inside module-info.java (edited MANIFEST file with Automatic-Module-Name attribute)
[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] -------------------------------------------------------------
How can I resolve these issues while running and building my application?
Some info in a related question on similar errors:
though your exact cause of how you generated this error will be different from the cause mentioned in that answer.
Whatever it is that you did when you did this is wrong:
declared them inside
module-info.java
(edited MANIFEST file withAutomatic-Module-Name
attribute)
Your easiest solution when working with non-modular software is to make your application non-modular.
module-info.java
.Instructions for non-modular JavaFX applications are in the getting started instructions at openjfx.io.
I also recommend using modern Java and JavaFX versions (e.g. 21+) and a build tool (Maven or Gradle) synchronized with your IDE project.