0

The error in the title is what I have in my module-info.java. I am new to Java, so I hope I can understand your answers when you give them. I have found the other questions on here that ask the same question, and they probably have the answer, I just don't understand how to apply it to my situation.

javafx.base reads package javafx.beans

modular java project (IntelliJ IDEA): Module 'com.test' reads package 'javax.xml.bind' from both 'java.xml.bind' and 'java.xml.bind'

Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'

Here is what that file looks like:

module project{
    requires javafx.controls;
    requires javafx.fxml;
    requires sikulixapi;

    opens com.example to javafx.fxml;

    exports com.example;
}

When I comment out both of the javafx.* require lines, the error goes away.

I am using Intellij Idea, I created a Javafx project and added Maven.

How would I go about finding the solution to this problem?

HighHopes
  • 2,014
  • 3
  • 23
  • 33
  • Sounds like an Intellij error that isn't resolving that one includes the other – Johnny V Jul 03 '21 at 01:53
  • Mmm, that's a good direction to go. What would you suggest I search for to find out how to get Intellij Idea to resolve this? – HighHopes Jul 03 '21 at 02:10

1 Answers1

0

I think this is an Intellj problem. I created the Hello World JavaFX example in Eclipse and didn't have a problem.

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>demo</groupId>
    <artifactId>hello</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>13</version>
        </dependency>
         <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml </artifactId>
            <version>17-ea+14</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.6</version>
                <executions>
                    <execution>
                        <!-- Default configuration for running -->
                        <!-- Usage: mvn clean javafx:run -->
                        <id>default-cli</id>
                        <configuration>
                            <mainClass>demo.hello.App</mainClass>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

module-info.java

module demo.hello {
    requires javafx.controls;
    requires javafx.fxml;
    exports demo.hello;
}
Johnny V
  • 795
  • 5
  • 14
  • This is helpful as it means that I need to configure Intellij better. I beleive it is possibe to use Intellij for this project, like it says here: https://openjfx.io/openjfx-docs/#maven Do you think you could get that to work and tell me how you did it? Like I said, I am new to all this. – HighHopes Jul 07 '21 at 00:22
  • My project works fine in IntellJ (I just installed it just for you) here is the demo project https://file.io/M8un2C2tomia – Johnny V Jul 08 '21 at 00:28