Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+21 votes

IntelliJ keeps asking me to add "requires javafx.graphics" in the module-info.java even though the statement is already there. Can anyone help?

asked in CSC305 Fall 2023 by (1 point)

2 Answers

+5 votes
 
Best answer

I had the same error.
In your pom.xml file locate:
"

<plugin>
     <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
</plugin>

"
and change the <release>11</release> to

<release>17</release>

Reload maven.

This fixes the error.

answered by (1 point)
selected by
0

Thank you very much!

+5 votes

I faced a similar problem in the past, and the fix was to include the "package edu.augustana" at the beginning of one of my classes. If you've already done that, the issue might be related to a dependency problem. In that case, this Stack Overflow thread may be helpful: https://stackoverflow.com/questions/58233593/cant-get-javafx-to-run-in-eclipse

answered by (1 point)
...