DanielLeens commented on code in PR #11545:
URL: https://github.com/apache/seatunnel/pull/11545#discussion_r4227061757


##########
seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh:
##########
@@ -109,6 +109,32 @@ do
   fi
 done
 
+# SeaTunnel requires Java 11 or newer. Fail fast with an actionable message 
instead of letting a
+# JDK 8 launcher abort on the JDK 9+ module flags below with a cryptic 
"Unrecognized option" error.
+JAVA_MAJOR_VERSION=$(java -version 2>&1 | awk -F '[".]' '/version/ {print ($2 
== "1") ? $3 : $2; exit}')
+if [[ -n "$JAVA_MAJOR_VERSION" && "$JAVA_MAJOR_VERSION" -lt 11 ]]; then
+  echo "Error: SeaTunnel requires Java 11 or newer, but Java 
${JAVA_MAJOR_VERSION} was detected. Point JAVA_HOME/PATH at a Java 11+ JDK." >&2
+  exit 1
+fi
+
+# These JDK module flags are mandatory on Java 11+: Hazelcast needs reflective 
access to JDK
+# internals and the Kerberos krb5.conf reload needs the jgss export. They are 
appended here, not
+# only shipped in the config/jvm_*_options templates, so an in-place upgrade 
that preserves an old
+# config directory (mounted Docker volume, K8s ConfigMap) cannot silently drop 
them. Appending a
+# flag twice is harmless, so config files that already carry them stay 
compatible.
+for module_flag in \
+  "--add-opens=java.base/java.lang=ALL-UNNAMED" \
+  "--add-opens=java.base/java.net=ALL-UNNAMED" \
+  "--add-opens=java.base/java.nio=ALL-UNNAMED" \

Review Comment:
   @goutamadwant follow-up opened: 
https://github.com/apache/seatunnel/pull/12702
   
   It adds the same Java-version pre-check and the same six-flag fallback 
(skipping flags already present) to `seatunnel.cmd` and 
`seatunnel-cluster.cmd`, and updates the en/zh `incompatible-changes.md` entry 
to name the `.cmd` launchers. As I said above, it is not verified on Windows: I 
have no Windows environment, the PR description says so, and the CI matrix does 
not run these launchers. If you can run it on Windows with Java 8, 11 and 17, 
that would be the check that matters.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to