eclipsebrowserjavahelp

For maven dependencies from local repository, Eclipse can't open Javadoc in the browser


When from within Eclipse I try to open Javadoc in a browser, using the button "Open attached Javadoc in a browser" in the pop-up Javadoc window, for example, for JAssert that is in the local M2E repository, the browser opens an empty page. The URL, passed to the browser, is http://127.0.0.1:47264/help/nftopic/jar:file:/C:/Users/xxx/.m2/repository/org/assertj/assertj-core/3.22.0/assertj-core-3.22.0-javadoc.jar!/org.assertj.core/org/assertj/core/api/Assertions.html#assertThat(java.lang.String)

The file mentioned in the URL exists and contains the required Javadoc. The Javadoc location set in the project's Java Build Path for the library looks correct, it reads \Users\xxx\.m2\repository\org\assertj\assertj-core\3.22.0\assertj-core-3.22.0-javadoc.jar, and Eclipse shows the Javadoc in the pop-up window.

Is the URL correct? Is it Eclipse who responds on port 47264? If the URL is correct, why can't eclipse serve the request? If it's wrong, where in Eclipse can I fix it?

UPD: Both the jar file in the abovementioned location, and the path inside the jar exist, they can be opened via an explorer

the url doesn't open, the file opens:


Solution

  • According to your screenshot, the URL part that specifies the path of the HTML file inside the JAR is wrong: it has to be without /org.assertj.core, so that it start with !/org/... instead of !/org.assertj.core/org/... Maybe something is wrong with your project configuration.

    The URL http://127.0.0.1:47264/help/nftopic/jar:file:/C:/Users/xxx/.m2/repository/org/assertj/assertj-core/3.22.0/assertj-core-3.22.0-javadoc.jar!/org/assertj/core/api/Assertions.html#assertThat(java.lang.String) consists of the following parts: