This is an automated email from the ASF dual-hosted git repository.

zhouky pushed a commit to branch branch-0.2
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/branch-0.2 by this push:
     new 15cbf1d1 [CELEBORN-171] Support JDK11. (#1169)
15cbf1d1 is described below

commit 15cbf1d171d23d74a638445850dc1f00c8bc32fb
Author: Ethan Feng <[email protected]>
AuthorDate: Mon Jan 16 19:35:54 2023 +0800

    [CELEBORN-171] Support JDK11. (#1169)
---
 pom.xml              | 17 +++++++++++++++++
 sbin/start-worker.sh |  4 ++++
 2 files changed, 21 insertions(+)

diff --git a/pom.xml b/pom.xml
index 4218584c..891b5560 100644
--- a/pom.xml
+++ b/pom.xml
@@ -959,6 +959,23 @@
       </properties>
     </profile>
 
+    <profile>
+      <id>jdk-8</id>
+      <properties>
+        <java.version>8</java.version>
+      </properties>
+    </profile>
+
+    <profile>
+      <id>jdk-11</id>
+      <activation>
+        <jdk>11</jdk>
+      </activation>
+      <properties>
+        <java.version>11</java.version>
+      </properties>
+    </profile>
+
     <profile>
       <id>google-mirror</id>
       <properties>
diff --git a/sbin/start-worker.sh b/sbin/start-worker.sh
index e7824b89..ea4c4581 100755
--- a/sbin/start-worker.sh
+++ b/sbin/start-worker.sh
@@ -33,6 +33,10 @@ if [ "$CELEBORN_WORKER_OFFHEAP_MEMORY" = "" ]; then
 fi
 
 export CELEBORN_JAVA_OPTS="-Xmx$CELEBORN_WORKER_MEMORY 
-XX:MaxDirectMemorySize=$CELEBORN_WORKER_OFFHEAP_MEMORY 
$CELEBORN_WORKER_JAVA_OPTS"
+JAVA_VERSION=$(java -version 2>&1 | grep " version " | head -1 | awk '{print 
$3}' | tr -d '"')
+if [[ ! "$JAVA_VERSION" == 1.8.* ]]; then
+  export CELEBORN_JAVA_OPTS="${CELEBORN_JAVA_OPTS} --add-opens 
java.base/jdk.internal.misc=ALL-UNNAMED --illegal-access=warn 
-Dio.netty.tryReflectionSetAccessible=true"
+fi
 
 if [ "$WORKER_INSTANCE" = "" ]; then
   WORKER_INSTANCE=1

Reply via email to