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

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit fe41448780c08ed0b7693ede3996a68ff1d76a60
Author: Laszlo Gaal <[email protected]>
AuthorDate: Mon Nov 10 21:31:04 2025 +0100

    IMPALA-14603: Force Java alternative after setup on Rocky and Red Hat Linux
    
    Impala allows various Java versions to be selected for its build and
    runtime environment when bin/bootstrap_system.sh is used to set up the
    environment. Unfortunately this setup failed to affect the current Java
    JRE and compiler tools on Red Hat Linux and compatibles (e.g. Rocky
    Linux), because bootstrap_system.sh failed to set up the requested
    version in the "alternatives" subsystem. The same failure was not
    observed on Ubuntu versions, on that platform `update_java_alternatives`
    was correctly run for the same purpose.
    
    This patch adds calls to `alternatives` to set the JRE and JDK
    environments to the requested version. This benefits automated test runs
    in Impala's pre- and post-commit environments as well as individual
    workstation setups.
    
    Change-Id: I8972fb35b232830c6d8cf1125a7a8223547bd206
    Reviewed-on: http://gerrit.cloudera.org:8080/23741
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 bin/bootstrap_system.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/bootstrap_system.sh b/bin/bootstrap_system.sh
index 3f0ce3619..ec5dc7ac5 100755
--- a/bin/bootstrap_system.sh
+++ b/bin/bootstrap_system.sh
@@ -301,6 +301,11 @@ redhat sudo yum install -y file gawk gcc gcc-c++ git 
krb5-devel krb5-server \
         net-tools langpacks-en glibc-langpack-en libxml2-devel libxslt-devel \
         java-${REDHAT_JAVA_VERSION}-openjdk-src 
java-${REDHAT_JAVA_VERSION}-openjdk-devel
 
+redhat sudo alternatives --set java 
java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+redhat sudo alternatives --set javac 
java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+redhat sudo alternatives --set java_sdk_openjdk 
java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+redhat sudo alternatives --set jre_openjdk 
java-${REDHAT_JAVA_VERSION}-openjdk.${ARCH_NAME}
+
 # update-java-alternatives may not take effect if there is a Java in PATH
 which java
 java -version

Reply via email to