2

I have created a new Java 10 project in Eclipse 4.7.3a

This is a maven project with some dependencies.

The project is called "MyProject" and below is my module-info.java

module myproject {
    exports myproject;

    requires commons.logging;
    requires htmlunit;
    requires htmlunit.cssparser;
    requires java.logging;
    requires java.xml;
    requires selenium.api;
    requires selenium.firefox.driver;
    requires selenium.remote.driver;
}

when I run the project I get the following

Error occurred during initialization of boot layer
java.lang.module.FindException: Module myproject not found

What am I doing wrong here?

Naman
  • 27,789
  • 26
  • 218
  • 353
Arya
  • 8,473
  • 27
  • 105
  • 175
  • Well, the certain point is the module not being resolved during the runtime. The reason behind it could also possibly be Eclipse, but could you verify executing the same project via normal command line? – Naman May 14 '18 at 16:27
  • I created a new Java project called "Test" I used jdk.incubator.httpclient; in module-info.java and everything worked fine, as soon as I converted it to a Maven project the error started to happen – Arya May 14 '18 at 18:08
  • I assume this is a bug – Arya May 14 '18 at 18:48
  • Possible duplicate of [How to run a Java 9 main class in Eclipse without editing a launch-configuration?](https://stackoverflow.com/questions/47728515/how-to-run-a-java-9-main-class-in-eclipse-without-editing-a-launch-configuration) – ZhekaKozlov May 15 '18 at 17:40

2 Answers2

3

The maven integration in 4.7.3a doesn't support launching modular applications (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=529398)

This has been implemented for Eclipse 4.8 (Photon) which will be released in June.

You can already use a (feature complete) milestone build from http://download.eclipse.org/eclipse/downloads/. If you find any bugs, please report them at https://bugs.eclipse.org/bugs/

Till Brychcy
  • 2,876
  • 1
  • 18
  • 28
-1

the same issue with same error while doing automating browser, just remove or delete the module info file, it will be solve

  • 1
    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 Dec 06 '22 at 09:32