'java.lang.module.FindException: Module test not foundIntellidea
I am have this Exception please help me! "Error occurred during initialization of boot layer java.lang.module.Find Exception: Module test not found"
But i write VM option "--module-path "D:\UT java\javafx-sdk-17.0.1\lib" --add-modules javafx.controls,javafx.fxml"
and i have module-info.java "
requires javafx.fxml;
requires javafx.controls;
requires javafx.graphics;
requires java.sql;
requires java.desktop;
requires jdk.jfr;"
i add my sdk. And if i create javafx demo project and execute him it work. and if i start change fxml file and change controller i have this exception. I have IntellIJIdea 2021, javafx-sdk-17.0.1, jdbc jr 8,11,16
Solution 1:[1]
Steps to fix:
Delete the JavaFX sdk (you don’t need it).
Delete old Java versions (they are obsolete).
Update your IntelliJ IDE and IDE plugins to the most recent release, 2021.3.2+.
Create a new JavaFX project using JDK and JavaFX 17.0.2+.
- Select Maven for the build system unless you know and prefer Gradle.
Do not set VM arguments, you don’t need them.
- Adding modules via the
--add-modulesVM arguments is unnecessary when you have a validmodule-info.javafile. - The
--module-pathis still required so that the modules can be found, but Idea will provide the correct path for your modules automatically when it recognizes the modules through your Maven dependencies. - So you don't need to explicitly define the
--module-pathVM argument yourself for a Maven based build (that would be difficult to do anyway because the modules are all downloaded to different directories in your local maven repository).
- Adding modules via the
Test it works following the Idea create new JavaFX project execution instructions.
Add additional modules one at a time by adding their maven dependency to
pom.xmland the requires clause tomodule-info.java.- Ensure you synchronize the Maven and Idea projects between each addition.
- See, for example, this question on correctly adding the
javafx.mediamodule. - Adding other modules such as
javafx.web,javafx.fxmlorjavafx.swingfollows a similar pattern.
Test between each addition by building and running the project, to ensure you haven’t broken anything.
Copy your original source code into the appropriate package directories under the new project source directory:
src/main/javaPlace resources in:
src/main/resourcesfollowing the Eden resource location guide.
Fix any errors, ensure everything compiles and runs, then test it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
