You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/10/12 19:43:13 UTC

[GitHub] [incubator-kyuubi] pan3793 opened a new pull request, #3619: Enhance JAVA_HOME detection to support RPM

pan3793 opened a new pull request, #3619:
URL: https://github.com/apache/incubator-kyuubi/pull/3619

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   By default, on CentOS 7 w/ openJDK 8 installed via YUM/RPM, the `/usr/bin/java` links to `/usr/lib/jvm/java-1.8.0-openjdk/jre/bin/java`, the current detection logic will think the `JAVA_HOME` is `/usr/lib/jvm/java-1.8.0-openjdk/jre`, and then cause the issue.
    
   ```
   [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.6.1:compile (scala-compile-first) on project kyuubi-common_2.12: wrap: java.io.IOException: Cannot run program "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.322.b06-1.el7_9.x86_64/jre/bin/javac" (in directory "/home/pancheng/apache-kyuubi"): error=2, No such file or directory -> [Help 1]
   ```
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [x] Add screenshots for manual tests if appropriate
   
   w/ this patch, the `build/dist` works expected on CentOS w/ openJDK 8 installed via `yum`, the debug info shows if detect the right `JAVA_HOME`
   ```
   + [[ -z '' ]]
   ++ command -v rpm
   + '[' /usr/bin/rpm ']'
   ++ rpm -E %java_home
   + RPM_JAVA_HOME=/usr/lib/jvm/java
   + '[' /usr/lib/jvm/java '!=' %java_home ']'
   + JAVA_HOME=/usr/lib/jvm/java
   + echo 'No JAVA_HOME set, proceeding with '\''/usr/lib/jvm/java'\'' learned from rpm'
   No JAVA_HOME set, proceeding with '/usr/lib/jvm/java' learned from rpm
   + '[' -z /usr/lib/jvm/java ']'
   + [[ -z /usr/lib/jvm/java ]]
   + echo 'JAVA_HOME is set to /usr/lib/jvm/java'
   JAVA_HOME is set to /usr/lib/jvm/java
   ```
   
   - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 closed pull request #3619: Enhance JAVA_HOME detection to support RPM

Posted by GitBox <gi...@apache.org>.
pan3793 closed pull request #3619: Enhance JAVA_HOME detection to support RPM
URL: https://github.com/apache/incubator-kyuubi/pull/3619


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #3619: Enhance JAVA_HOME detection to support RPM

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #3619:
URL: https://github.com/apache/incubator-kyuubi/pull/3619#discussion_r993835946


##########
build/dist:
##########
@@ -114,6 +126,7 @@ if [[ -z "$JAVA_HOME" ]]; then
   exit -1
 fi
 
+export JAVA_HOME="$JAVA_HOME"

Review Comment:
   we should export it, otherwise mvn can not see it.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on pull request #3619: Enhance JAVA_HOME detection to support RPM

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #3619:
URL: https://github.com/apache/incubator-kyuubi/pull/3619#issuecomment-1278470498

   Thanks, merging to master/1.6


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org