so I have the Problem that I havent opened my project in a while now and when I opened it and tried starting it again it threw this Error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: /Users/myname/Desktop/..../build/libs/fireApp-1.0-SNAPSHOT.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Package com.unknown.fireApp not found in module
Caused by: java.lang.module.InvalidModuleDescriptorException: Package com.unknown.fireApp not found in module
Execution failed for task ':FireApp.main()'.
These are my Files:
build.gradle:
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.13'
id 'org.beryx.jlink' version '2.25.0'
}
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.8.2'
}
sourceCompatibility = '17'
targetCompatibility = '17'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
mainModule = 'com.unknown.fireApp'
mainClass = 'com.unknown.fireApp.FireApp'
}
javafx {
version = '18.0.1'
modules = ['javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.media', 'javafx.base','javafx.swing']
}
dependencies {
implementation('org.controlsfx:controlsfx:11.1.1')
implementation('com.dlsc.formsfx:formsfx-core:11.5.0') {
exclude(group: 'org.openjfx')
}
implementation('net.synedra:validatorfx:0.3.1') {
exclude(group: 'org.openjfx')
}
implementation('org.kordamp.ikonli:ikonli-javafx:12.3.1')
implementation('org.kordamp.bootstrapfx:bootstrapfx-core:0.4.0')
implementation('eu.hansolo:tilesfx:17.1.9') {
exclude(group: 'org.openjfx')
}
implementation('com.github.almasb:fxgl:17.1') {
exclude(group: 'org.openjfx')
}
implementation 'junit:junit:4.12'
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
//SQLITE
implementation 'org.xerial:sqlite-jdbc:3.39.2.0'
implementation 'mysql:mysql-connector-java:8.0.30'
//ARGON PW HASHING
implementation 'de.mkammerer:argon2-jvm:2.11'
implementation 'net.java.dev.jna:jna:5.12.1'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2'
//JAVA MAIL API
// https://mvnrepository.com/artifact/org.eclipse.angus/jakarta.mail
implementation 'org.eclipse.angus:jakarta.mail:2.0.3'
//MOCKITO
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testImplementation 'org.mockito:mockito-core:5.11.0'
}
sourceSets {
main {
java {
srcDirs= ["src/main/java"]
}
resources {
srcDirs= ["src/main/resources"]
}
}
}
test {
useJUnitPlatform()
}
jlink {
imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
}
}
jlinkZip {
group = 'distribution'
}
the module info:
module com.unknown.fireApp {
requires javafx.controls;
requires javafx.fxml;
requires javafx.base;
requires javafx.graphics;
requires javafx.web;
requires org.controlsfx.controls;
requires com.dlsc.formsfx;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.bootstrapfx.core;
requires de.mkammerer.argon2.nolibs;
requires com.almasb.fxgl.all;
requires java.xml.crypto;
requires java.sql;
requires com.sun.jna;
requires jakarta.mail;
requires hamcrest.core;
opens com.unknown.fireApp to javafx.controls, javafx.graphics;
exports com.unknown.fireApp.api;
exports com.unknown.fireApp.controller;
exports com.unknown.fireApp.database;
exports com.unknown.fireApp.exceptions;
exports com.unknown.fireApp.models;
exports com.unknown.fireApp.services;
}
My Main class:
package com.unknown.fireApp;
import com.unknown.fireApp.database.SQLiteDatabase;
import com.unknown.fireApp.services.BackupService;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.util.Objects;
public class FireApp extends Application {
private final BackupService backupService = new BackupService();
public static void main(String[] args) {
SQLiteDatabase sqLiteDatabase = new SQLiteDatabase();
if (sqLiteDatabase.openDBConnection()) {
sqLiteDatabase.initDB();
}
launch();
}
@Override
public void start(Stage stage) {
backupService.createBackUpFolder();
backupService.createAutomaticBackup();
backupService.deleteBackupsOlderThanOneWeek();
Platform.runLater(() -> {
try {
Parent root = FXMLLoader.load(Objects.requireNonNull(FireApp.class.getResource("/com.unknown.fireApp/pages/LoginPage.fxml")));
Scene loginScene = new Scene(root,1000,700);
root.getStylesheets().add(Objects.requireNonNull(FireApp.class.getResource("/com.unknown.fireApp/styling/LoginStyle.css")).toExternalForm());
stage.setScene(loginScene);
stage.setResizable(false);
stage.setOnCloseRequest(e -> {
Platform.exit();
System.exit(0);
});
stage.setTitle("Fire App");
stage.centerOnScreen();
stage.show();
}catch (Exception e){
e.printStackTrace();
throw new RuntimeException(e);
}
});
}
}
Versions:
SDK: Eclipse Temurin 21.0.3
Java Version: OpenJDK 21.0.3
VM Option:
–module-path /Users/myname/Desktop/…/Tools/javafx-sdk-21.0.2/lib –add-modules=javafx.controls,javafx.fxml,javafx.base
I tried repulling the Project, changing different versions and tried clean building the project.
Nothing seems to work.