diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala
index 520a5692afb8..9174b573786b 100644
--- a/compiler/src/dotty/tools/dotc/core/Definitions.scala
+++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala
@@ -2494,14 +2494,14 @@ class Definitions {
""".stripMargin)
add(Object_wait,
- """/** See [[https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--]].
+ """/** See [[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()]].
| *
| * @note not specified by SLS as a member of AnyRef
| */
""".stripMargin)
add(Object_waitL,
- """/** See [[https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-]].
+ """/** See [[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)]].
| *
| * @param timeout the maximum time to wait in milliseconds.
| * @note not specified by SLS as a member of AnyRef
@@ -2509,7 +2509,7 @@ class Definitions {
""".stripMargin)
add(Object_waitLI,
- """/** See [[https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-]]
+ """/** See [[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)]]
| *
| * @param timeout the maximum time to wait in milliseconds.
| * @param nanos additional time, in nanoseconds range 0-999999.
diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala
index 86223cde31c9..6cc1495410e8 100644
--- a/compiler/src/dotty/tools/dotc/core/Types.scala
+++ b/compiler/src/dotty/tools/dotc/core/Types.scala
@@ -1102,7 +1102,7 @@ object Types extends TypeUtils {
* methods of [[java.lang.Object]], that also does not count toward the interface's
* abstract method count.
*
- * @see https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html
+ * @see https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/FunctionalInterface.html
*
* @return the set of methods that are abstract and do not match any of [[java.lang.Object]]
*
diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
index b46c780480ff..85da9480741b 100644
--- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala
+++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala
@@ -463,7 +463,7 @@ object Erasure {
* will throw a `NullPointerException` instead. See `lambda-null.scala`
* for test cases.
*
- * @see [LambdaMetaFactory](https://docs.oracle.com/javase/8/docs/api/java/lang/invoke/LambdaMetafactory.html)
+ * @see [LambdaMetaFactory](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/invoke/LambdaMetafactory.html)
*/
def autoAdaptedParam(tp: Type) =
!tp.isErasedValueType && !tp.isPrimitiveValueType
diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala
index 8b4e00a11d35..4fe21c4f48a1 100644
--- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala
@@ -1581,7 +1581,7 @@ trait Implicits:
/** Check if `ord` respects the contract of `Ordering`.
*
* More precisely, we check that its `compare` method respects the invariants listed
- * in https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T-
+ * in https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Comparator.html#compare(T,T)
*/
def validateOrdering(ord: Ordering[Candidate]): Unit =
for
diff --git a/compiler/src/dotty/tools/io/Path.scala b/compiler/src/dotty/tools/io/Path.scala
index 6aa7bba12b1c..195c5ed823f6 100644
--- a/compiler/src/dotty/tools/io/Path.scala
+++ b/compiler/src/dotty/tools/io/Path.scala
@@ -133,7 +133,7 @@ class Path private[io] (val jpath: JPath) {
// We don't call JPath#normalize here because it may result in resolving
// to a different path than intended, such as when the given path contains
// a `..` component and the preceding name is a symbolic link.
- // https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#normalize--
+ // https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Path.html#normalize()
//
// Paths ending with `..` or `.` are handled specially here as
// JPath#getParent wants to simply strip away that last element.
diff --git a/docs/_docs/reference/enums/enums.md b/docs/_docs/reference/enums/enums.md
index 3bd40f88c368..b9125c8493e9 100644
--- a/docs/_docs/reference/enums/enums.md
+++ b/docs/_docs/reference/enums/enums.md
@@ -171,7 +171,7 @@ enum Color extends Enum[Color]:
case Red, Green, Blue
```
-The type parameter comes from the Java enum [definition](https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/Enum.html) and should be the same as the type of the enum.
+The type parameter comes from the Java enum [definition](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Enum.html) and should be the same as the type of the enum.
There is no need to provide constructor arguments (as defined in the Java API docs) to `java.lang.Enum` when extending it – the compiler will generate them automatically.
After defining `Color` like that, you can use it like you would a Java enum:
diff --git a/docs/_spec/APPLIEDreference/enums/enums.md b/docs/_spec/APPLIEDreference/enums/enums.md
index d8fdbe9f1db2..838c59da8db8 100644
--- a/docs/_spec/APPLIEDreference/enums/enums.md
+++ b/docs/_spec/APPLIEDreference/enums/enums.md
@@ -168,7 +168,7 @@ If you want to use the Scala-defined enums as [Java enums](https://docs.oracle.c
enum Color extends Enum[Color] { case Red, Green, Blue }
```
-The type parameter comes from the Java enum [definition](https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/Enum.html) and should be the same as the type of the enum.
+The type parameter comes from the Java enum [definition](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Enum.html) and should be the same as the type of the enum.
There is no need to provide constructor arguments (as defined in the Java API docs) to `java.lang.Enum` when extending it – the compiler will generate them automatically.
After defining `Color` like that, you can use it like you would a Java enum:
diff --git a/library-js/src/scala/concurrent/ExecutionContext.scala b/library-js/src/scala/concurrent/ExecutionContext.scala
index 729be2163ece..45162465b1d2 100644
--- a/library-js/src/scala/concurrent/ExecutionContext.scala
+++ b/library-js/src/scala/concurrent/ExecutionContext.scala
@@ -107,13 +107,13 @@ trait ExecutionContext {
/**
* An [[ExecutionContext]] that is also a
- * Java [[http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executor.html Executor]].
+ * Java [[http://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/Executor.html Executor]].
*/
trait ExecutionContextExecutor extends ExecutionContext with Executor
/**
* An [[ExecutionContext]] that is also a
- * Java [[http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html ExecutorService]].
+ * Java [[http://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/concurrent/ExecutorService.html ExecutorService]].
*/
trait ExecutionContextExecutorService extends ExecutionContextExecutor with ExecutorService
@@ -175,7 +175,7 @@ object ExecutionContext {
*
* The default `ExecutionContext` implementation is backed by a work-stealing thread pool. By default,
* the thread pool uses a target number of worker threads equal to the number of
- * [[https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#availableProcessors-- available processors]].
+ * [[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.html#availableProcessors() available processors]].
*/
implicit final def global: ExecutionContext = ExecutionContext.global
}
@@ -220,7 +220,7 @@ object ExecutionContext {
*/
def fromExecutor(e: Executor): ExecutionContextExecutor = fromExecutor(e, defaultReporter)
- /** The default reporter simply prints the stack trace of the `Throwable` to [[http://docs.oracle.com/javase/8/docs/api/java/lang/System.html#err System.err]].
+ /** The default reporter simply prints the stack trace of the `Throwable` to [[http://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/System.html#err System.err]].
*
* @return the function for error reporting
*/
diff --git a/library/src/scala/collection/StringOps.scala b/library/src/scala/collection/StringOps.scala
index f72d4553b560..f6c6cf6f5517 100644
--- a/library/src/scala/collection/StringOps.scala
+++ b/library/src/scala/collection/StringOps.scala
@@ -796,7 +796,7 @@ final class StringOps(private val s: String) extends AnyVal { self =>
* If the separator character is a surrogate character, only split on
* matching surrogate characters if they are not part of a surrogate pair
*
- * The behaviour follows, and is implemented in terms of String.split(re: String)
+ * The behaviour follows, and is implemented in terms of String.split(re: String)
*
*
* @example {{{
diff --git a/library/src/scala/jdk/StreamConverters.scala b/library/src/scala/jdk/StreamConverters.scala
index c0cf5a2c5cc8..77eba2cbde7f 100644
--- a/library/src/scala/jdk/StreamConverters.scala
+++ b/library/src/scala/jdk/StreamConverters.scala
@@ -18,7 +18,7 @@ import scala.collection.convert.StreamExtensions
/** This object provides extension methods to create [[java.util.stream.Stream Java Streams]] that
* operate on Scala collections (sequentially or in parallel). For more information on Java
* streams, consult the documentation
- * ([[https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html]]).
+ * ([[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/package-summary.html]]).
*
* When writing Java code, use the explicit conversion methods defined in
* [[javaapi.StreamConverters]] instead.
diff --git a/library/src/scala/jdk/javaapi/StreamConverters.scala b/library/src/scala/jdk/javaapi/StreamConverters.scala
index f91c34e0b711..cedf6d1813df 100644
--- a/library/src/scala/jdk/javaapi/StreamConverters.scala
+++ b/library/src/scala/jdk/javaapi/StreamConverters.scala
@@ -18,7 +18,7 @@ import java.{lang => jl}
/** This object contains methods to create Java Streams that operate on Scala collections
* (sequentially or in parallel). For more information on Java streams, consult the documentation
- * ([[https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html]]).
+ * ([[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/stream/package-summary.html]]).
*
* The explicit conversion methods defined here are intended to be used in Java code. For Scala
* code, it is recommended to use the extension methods defined in [[scala.jdk.StreamConverters]].
diff --git a/library/src/scala/util/matching/Regex.scala b/library/src/scala/util/matching/Regex.scala
index 2ee22a960d19..990ccdcdf352 100644
--- a/library/src/scala/util/matching/Regex.scala
+++ b/library/src/scala/util/matching/Regex.scala
@@ -35,7 +35,7 @@ import java.util.regex.{ Pattern, Matcher }
*
* === Usage ===
- * This class delegates to the [[https://docs.oracle.com/javase/8/docs/api/java/util/regex/package-summary.html java.util.regex]] package of the Java Platform.
+ * This class delegates to the [[https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/package-summary.html java.util.regex]] package of the Java Platform.
* See the documentation for [[java.util.regex.Pattern]] for details about
* the regular expression syntax for pattern strings.
*
diff --git a/tests/explicit-nulls/pos/interop-java-varargs.scala b/tests/explicit-nulls/pos/interop-java-varargs.scala
index 46dc388d02af..fe64ca2284eb 100644
--- a/tests/explicit-nulls/pos/interop-java-varargs.scala
+++ b/tests/explicit-nulls/pos/interop-java-varargs.scala
@@ -4,7 +4,7 @@ import java.nio.file.Paths
class S {
// Paths.get is a Java method with two arguments, where the second one
- // is a varargs: https://docs.oracle.com/javase/8/docs/api/java/nio/file/Paths.html
+ // is a varargs: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Paths.html
// static Path get(String first, String... more)
// The Scala compiler converts this signature into
// def get(first: String | Null, more: (String | Null)*)