-1

I know this is a often-asked question but none of the answers I found on the internet helped me. My setup is: maven project with JavaFX as dependency defined in the pom.xml. I tried this. But to no avail.. Here is my pom.xml

The relevant pom.xml entry:

<dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>18.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-base</artifactId>
            <version>18.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>18.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-graphics</artifactId>
            <version>18.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-media</artifactId>
            <version>18.0.1</version>
        </dependency>
      ...

Any help is appreciated, thanks!

Adrian
  • 468
  • 2
  • 6
  • 15
Fingolfin
  • 13
  • 1
  • 4
  • Please [edit] your question to indicate the specific problem you encounter; a [mre] may make your intent more clear. – trashgod Jul 03 '22 at 15:33
  • You have stuff in your pastebin which is not in your question (please don't do that, make the question standalone). The stuff in pastebin is probably relevant to your issue (e.g. it uses an assembly plugin and a jar plugin with dependencies and whatever the google addjars thing is doing). None of those additional tasks are standard for a JavaFX project, I don't recommend them. Follow the instructions at [openjfx.io](https://openjfx.io/openjfx-docs/) or the [steps in this answer](https://stackoverflow.com/questions/71498158/java-lang-module-findexception-module-test-not-foundintellidea). – jewelsea Jul 05 '22 at 23:22
  • @jewelsea, of course there is stuff in pastebin that is not relevant, as I literally posted the whole of my pom.xml for clarification.. no, the stuff is not relevant to my question as IntelliJ reports JavaFX as missing and not maven.. this is an error on IntelliJs side not on the build systems, thanks for your links but none helped – Fingolfin Sep 25 '22 at 17:19

1 Answers1

0

I think it is because you haven't included the plugin. Add this piece of code to your pom.xml file.

<plugins>
    <plugin>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>0.0.8</version>
        <configuration>
            <mainClass>HelloFX</mainClass>
        </configuration>
    </plugin>
</plugins>

Reference to JavaFX documentation: https://openjfx.io/openjfx-docs/#maven

  • It is already included: I got it under plugins starting in line 94 – Fingolfin Jul 04 '22 at 22:56
  • @Fingolfin please share your full build.gradle. –  Jul 08 '22 at 17:39
  • It is already linked under `Here is my pom.xml` but.. here we go again: [LINK](https://pastebin.com/cvndpYKG) this is btw not an answer, as one can see its already included in my [pom.xml](https://pastebin.com/cvndpYKG) – Fingolfin Sep 25 '22 at 17:15