Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JUnit5, Javadoc not working with module-info.java(How to configure JUnit and Javadoc in the presence of module-infos?)
JUnit5, Javadoc not working with module-info.java [message #1849185] Thu, 06 January 2022 14:12 Go to next message
Steve VZZZ is currently offline Steve VZZZFriend
Messages: 1
Registered: January 2022
Junior Member
I downloaded and installed a fresh version of Eclipse 2021-12 for Java developers. I followed the instructions given in (forum won't allow a link here, search for junit-tutorial-for-beginner-with-eclipse, it just goes through the basic steps of creating a project and adding a JUnit5 test with all the standard settings).

This works if the box to add module-info.java is NOT checked when the Java project is created. If the box is checked to add module-info.java, then errors are generated such as "The type org.junit.jupiter.api.Assertions is not accessible."

I was able to get the Junit test running by manually editing the build properties. I moved the JUnit5 library from the Classpath to the Modulepath and then added "requires org.junit.jupiter.api;" to the module-info file. However, this breaks Javadoc generation, with the error "module not found: org.junit.jupiter.api"

I could try adding a --module-path to the Javadoc VM, but what would the path be for the built-in JUnit5 library?

Is this the same problem that breaks Javadoc when one module project depends on another? Is there a --module-path to an Eclipse Java module project that points to what Javadoc needs?

I noticed that if the box to include a module-info is unchecked when creating a project, that becomes the default for other project creations.

Re: JUnit5, Javadoc not working with module-info.java [message #1853230 is a reply to message #1849185] Thu, 23 June 2022 13:28 Go to previous message
Ahmet Ekrem SABAN is currently offline Ahmet Ekrem SABANFriend
Messages: 21
Registered: April 2011
Location: Austria
Junior Member
Same problem: didn't know that the option of accepting a module-info.java would have such results. Could create a JUnit file automatically, but with error messages like you wrote. When deleting this info file, the JUnit errors vanish immediately!

Best regards!
Ekrem
Previous Topic:Automatically add own Methods to your project
Next Topic:Why the special characters after Chinese become smaller?
Goto Forum:
  


Current Time: Fri Apr 19 22:21:19 GMT 2024

Powered by FUDForum. Page generated in 0.02905 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top