You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "pan3793 (via GitHub)" <gi...@apache.org> on 2026/05/26 08:29:41 UTC

Re: [PR] [CELEBORN-1682] Add java tools.jar into classpath for JVM quake [celeborn]

pan3793 commented on code in PR #2874:
URL: https://github.com/apache/celeborn/pull/2874#discussion_r3302345005


##########
sbin/load-celeborn-env.sh:
##########
@@ -44,12 +44,24 @@ if [ -n "${JAVA_HOME}" ]; then
 else
   if [ "$(command -v java)" ]; then
     export JAVA="java"
+    JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home' | awk '{print $3}')
   else
     echo "JAVA_HOME is not set" >&2
     exit 1
   fi
 fi
 
+# Find the java tools.jar
+if [ -f "${JAVA_HOME}/lib/tools.jar" ]; then
+  export JAVA_TOOLS_JAR="${JAVA_HOME}/lib/tools.jar"
+else
+  if [ -f "${JAVA_HOME}/../lib/tools.jar" ]; then
+    export JAVA_TOOLS_JAR="${JAVA_HOME}/../lib/tools.jar"
+  else
+    echo "WARNING: cannot locate tools.jar. Expected to find it in either ${JAVA_HOME}/lib/tools.jar or ${JAVA_HOME}/../lib/tools.jar"

Review Comment:
   is this only required for Java 8 ?



-- 
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: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org