0

I'm struggling with the code within my module-info.java file to when reorganizing my classes into relevant packages, my code was running fine before I moved them but i wanted to tidy up a little for future maintenance and now I'm running into trouble with location errors when running the project.

module-info.java:

module com.example.trademarket {
    requires javafx.controls;
    requires javafx.fxml;

    requires org.controlsfx.controls;
    requires org.kordamp.bootstrapfx.core;
    requires java.sql;
    requires org.apache.commons.codec;


    //requires com.google.gson;
    //requires org.apache.httpcomponents.httpclient;
    //requires org.apache.httpcomponents.httpcore;

    opens com.example.trademarket to javafx.fxml;
    //exports com.example.trademarket;
    //exports com.example.trademarket.classes;
    //opens com.example.trademarket.classes to javafx.fxml;
    //exports com.example.trademarket.controller;
    //opens com.example.trademarket.controller to javafx.fxml;
    //exports com.example.trademarket.application;
    opens com.example.trademarket.application to javafx.fxml;
}

The file structure i am trying to achieve:

(https://i.stack.imgur.com/6bQWX.png)

The error message I'm getting:

Caused by: java.lang.module.InvalidModuleDescriptorException: Package com.example.trademarket not found in module

I've tried changing the 'opens' and 'exports' statements in the file but this hasn't worked yet.

wizard
  • 1
  • 1
  • 2
    Can you [edit] your question and post details of these _location errors_ that you mention in your question? – Abra Jun 19 '23 at 04:22
  • 1
    Use an `IDE` like `Netbeans` and let it do the work for you. Are your `FXML` files pointing to their `Controllers` in the correct location? – SedJ601 Jun 19 '23 at 09:33
  • Verify that your `.fxml` files are accessible, for [example](https://stackoverflow.com/a/19603055/230513). – trashgod Jun 19 '23 at 12:44

0 Answers0