0

I receive the error :

java.lang.module.FindException: Module com.example.test not found

Process finished with exit code 1

I have been looking for a solution myself but have not been able to find one as either they didn't apply/work. I noticed there were mentioning changing --module-path in the VM Options but this (--module-path) was nowhere in my VM options(I haven't touched VM options ever)

Under my java files and next to the folder com.example.test there is module-info.java which is just:

module com.example.test {
requires javafx.controls;
requires javafx.fxml;
requires java.desktop;

    opens com.example.test to javafx.fxml;
    exports com.example.test;

}

I'm not sure why it isn't working, It was working earlier in the morning on my current PC, I was able to run it at school on the school pc and a friend's laptop but now I'm getting this error instead.

Thanks in advance.

  • https://stackoverflow.com/questions/59919046/java-13-eclipse-java-lang-module-findexception-module-abalonegame-not-found – SedJ601 May 17 '23 at 21:14

2 Answers2

1

You are using Idea, create a new JavaFX project. I advise selecting Maven as the build tool when you do so. Then your module will be found with no problem.

Also, ensure that you are using the most recent stable versions of Maven and Idea as earlier versions may not have as high a quality integration with and understanding of the Java module system.

Further info is in the answer to:

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • My original project was already using Maven, and like you said making a new one did work; I did post a response to my question since I hadn't seen yours saying copying the general project file made it work but not the original – Real Darkflare May 17 '23 at 22:40
-1

Alright so I'm responding cuz I got it to "work". I copied the project and ran the copy which actually works, just the original doesn't. If anyone finds the "real" solution would be great to know.

  • You already have a "real solution". If you are asking why your original project did not function as you expect, who can say? There is not enough information provided to answer that, and likely it isn't worth answering in any case. If you want to understand the module system in general so you can further debug it yourself, there are [tutorials for that](https://jenkov.com/tutorials/java/modules.html). – jewelsea May 17 '23 at 22:45
  • @jewelsea Yeah I'm aware that it probably won't get an answer/isn't worth the time, thanks for your time tho. – Real Darkflare May 17 '23 at 22:54
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 18 '23 at 04:15