From b588e5620e093bd6f479a3837d485c73759f590e Mon Sep 17 00:00:00 2001 From: chaokunyang Date: Tue, 4 Aug 2026 23:53:17 +0800 Subject: [PATCH] docs(java): clarify JDK 25 module opening recommendation --- README.md | 2 +- docs/json/getting-started.md | 2 +- docs/object-serialization/java/index.md | 2 +- docs/object-serialization/java/troubleshooting.md | 2 +- docs/object-serialization/kotlin/index.md | 2 +- docs/object-serialization/scala/index.md | 2 +- java/README.md | 2 +- java/fory-json/README.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6951de3742..c4bbca7952 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ Gradle: implementation "org.apache.fory:fory-core:1.5.0" ``` -On JDK25+, opening `java.lang.invoke` to Fory core is not required, but is recommended. It avoids the +On JDK25+, opening `java.lang.invoke` to Fory core is also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/docs/json/getting-started.md b/docs/json/getting-started.md index 4c451f7438..73554f9557 100644 --- a/docs/json/getting-started.md +++ b/docs/json/getting-started.md @@ -46,7 +46,7 @@ Use the same version for every Fory module in one application. ### JDK 25 and later -On JDK 25 and later, opening `java.lang.invoke` to Fory core is not required, but is recommended. It avoids +On JDK 25 and later, opening `java.lang.invoke` to Fory core is also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. For a classpath application: diff --git a/docs/object-serialization/java/index.md b/docs/object-serialization/java/index.md index 15fadb9c40..c012405925 100644 --- a/docs/object-serialization/java/index.md +++ b/docs/object-serialization/java/index.md @@ -76,7 +76,7 @@ implementation("org.apache.fory:fory-core:1.5.0") #### JDK 25 and Later -On JDK 25 and later, opening `java.lang.invoke` to Fory core is not required, but is recommended. It avoids +On JDK 25 and later, opening `java.lang.invoke` to Fory core is also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/docs/object-serialization/java/troubleshooting.md b/docs/object-serialization/java/troubleshooting.md index d70a027552..86e006319e 100644 --- a/docs/object-serialization/java/troubleshooting.md +++ b/docs/object-serialization/java/troubleshooting.md @@ -185,7 +185,7 @@ fory.registerSerializer(MyClass.class, new MyClassSerializer(fory.getTypeResolve ### JDK25+ access errors -On JDK25+, opening `java.lang.invoke` to Fory core is not required, but is recommended. Add the opening if +On JDK25+, opening `java.lang.invoke` to Fory core is also recommended. Add the opening if an error names `java.base/java.lang.invoke`, or when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/docs/object-serialization/kotlin/index.md b/docs/object-serialization/kotlin/index.md index 77dda3e8c9..991117292c 100644 --- a/docs/object-serialization/kotlin/index.md +++ b/docs/object-serialization/kotlin/index.md @@ -66,7 +66,7 @@ implementation("org.apache.fory:fory-kotlin:1.5.0") ### JDK25+ Kotlin uses the Fory Java core when running. On JDK25+, opening `java.lang.invoke` to Fory core is -not required, but is recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe +also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/docs/object-serialization/scala/index.md b/docs/object-serialization/scala/index.md index 7a10630b66..733725d957 100644 --- a/docs/object-serialization/scala/index.md +++ b/docs/object-serialization/scala/index.md @@ -55,7 +55,7 @@ libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.5.0" ### JDK25+ Scala uses the Fory Java core when running. On JDK25+, opening `java.lang.invoke` to Fory core is -not required, but is recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe +also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/java/README.md b/java/README.md index e9a3e9a2b8..4d92bc446d 100644 --- a/java/README.md +++ b/java/README.md @@ -137,7 +137,7 @@ dependencies { ### JDK25+ -On JDK25+, opening `java.lang.invoke` to Fory core is not required, but is recommended. It avoids the +On JDK25+, opening `java.lang.invoke` to Fory core is also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` when Fory is on the classpath: diff --git a/java/fory-json/README.md b/java/fory-json/README.md index 0e46a6d4f6..e3af227d8e 100644 --- a/java/fory-json/README.md +++ b/java/fory-json/README.md @@ -52,7 +52,7 @@ Gradle: implementation("org.apache.fory:fory-json:1.5.0") ``` -On JDK 25 and later, opening `java.lang.invoke` to Fory core is not required, but is recommended. It avoids +On JDK 25 and later, opening `java.lang.invoke` to Fory core is also recommended. It avoids the current-JDK Unsafe fallback and is required when Unsafe access is disabled or unavailable, including with `--sun-misc-unsafe-memory-access=deny`. Use `ALL-UNNAMED` on the classpath: