1

I'm having problems using JavaFX in a uni project and I'm just going around in circles. I'm new to Java, JavaFX and IntelliJ so any help would be greatly appreciated!

I initially set up a blank JavaFX project using the wizard in IntelliJ and then imported all my existing java packages and classes. Had lots of issues getting this to work but I've finally figured that bit out. I'm now having with the module-info.java file (please ignore the poorly named modules and packages I have, refactoring is next on my to-do list!):

module maptrix.wiseguide {
    requires junit;
    requires java.desktop;
    requires javafx.fxml;
    requires javafx.controls;

    opens maptrix.wiseguide to javafx.fxml;
    exports maptrix.wiseguide;
    exports serverclientstuff;
}

The program works and runs as expected but I get an error saying:

Module 'maptrix.wiseguide' reads package 'javafx.fxml' from both 'javafx.fxml' and 'javafx.fxml'

and the following warnings:

Ambiguous module reference: javafx.fxml
Ambiguous module reference: javafx.controls

I've seen this Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base' but I don't understand what they are trying to do. Hoping someone can dumb it down for me and help figure it out.

Thanks in advance!

Edit: This appears only to be a problem on my machine, the rest of the team aren't having this issue

Wpitchy
  • 97
  • 6
  • Looks like a dependency problem: the same library JavaFX in two versions. My advice would be to switch over to a new second **maven** JavaFX project while you wair for an answer here – Joop Eggen Feb 05 '22 at 12:43
  • When you run the project in idea you will sees something in the console which looks like: `"C:\Program Files\Java\jdk-17\bin\java.exe" ...`. Click on that line and dots will go away revealing the full command line which was used to run the app. Copy that and edit the question to add the command line, formatted as code. Also add the pom.xml for the project to the question formatted as code. Go to the project pane, collapse everything, then expand the top level "External Libraries" node and screenshot it so all the libraries are visible, then add the image to your question. – jewelsea Feb 05 '22 at 13:42

0 Answers0