<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Roman,</p>
    <p>TL;DR: The behavior is as expected.</p>
    <p>If nothing else, note that `--source` describes the language
      level of the input source code, and has no relationship whatsoever
      to HTML version used for the output. This is somewhat similar to
      javac, where `--source` specifies the version of the input source
      files, and `--target` specifies the classfile version of the
      generated class files.</p>
    <p>There are other major differences between JDK 8 javadoc and more
      recent versions.  More obvious than the version of HTML, there is
      the difference in the page layout: JDK 8 javadoc uses frames and
      predates the Search facility; later versions do not use frames,
      and provide the Search mechanism and more in-page links to aid
      with navigation.</p>
    <p>The issue of the form of anchors generated by different versions
      is an interesting special case, with no easy solution at this
      time, other than to use compatible versions of javadoc for the API
      being cross-linked. There is no information available to the
      `-link` or `-linkoffline` options to know the form of anchors used
      in the documentation being linked to.</p>
    <p>That being said, there is ongoing work to standardize _and
      specify_ the form of anchors and major structural elements to
      mitigate against problems going forward.<br>
    </p>
    <p>-- Jon<br>
    </p>
    <div class="moz-cite-prefix">On 11/18/22 7:32 AM, Roman Marchenko
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:DM8PR11MB573628AB6D41BB6708013B7ABF099@DM8PR11MB5736.namprd11.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">As far as I know<span lang="EN-US">,</span>
          Html4 support was removed from Javadoc a time ago. So now
          Javadoc generates html5-like anchors even with “-source 8” or
          “-release 8” option specified. There is JDK-8187521 added
          TestAnchorNames.testHtml5
          <span lang="EN-US">which </span>check<span lang="EN-US">s </span>if
          Html5-like anchors are generated for “-source 8” option.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">On the other hand, Java8’s Javadoc still
          supports html4 and doesn’t support html5. So it turns that
          docs generated by Java8’s Javadoc are not compatible with docs
          generated by any other
          <span lang="EN-US">(I guess starting from jdk17 and above)</span>
          “Javadoc -release 8” because they use different types of
          anchors.
          <span lang="EN-US">So it’s impossible to use cross links in
            such cases.<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-US">I haven’t found any
            discussion explaining that, so could anyone explain, please,
            if it is correct behavior or not?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">- Roman<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
    </blockquote>
  </body>
</html>