You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/12/24 16:07:58 UTC
[GitHub] [incubator-doris] morningman commented on a change in pull request #7428: [improvement] optimize java cmd find
morningman commented on a change in pull request #7428:
URL: https://github.com/apache/incubator-doris/pull/7428#discussion_r775048095
##########
File path: bin/start_fe.sh
##########
@@ -62,39 +62,39 @@ if [ -e $DORIS_HOME/bin/palo_env.sh ]; then
source $DORIS_HOME/bin/palo_env.sh
fi
-# java
-if [ "$JAVA_HOME" = "" ]; then
- echo "Error: JAVA_HOME is not set."
+if [ -z "$JAVA_HOME" ] ; then
+ JAVA=`which java`
Review comment:
4 spaces?
##########
File path: env.sh
##########
@@ -85,14 +85,21 @@ export CLANG_COMPATIBLE_FLAGS=`echo | ${DORIS_GCC_HOME}/bin/gcc -Wp,-v -xc++ - -
| grep -E '^\s+/' | awk '{print "-I" $1}' | tr '\n' ' '`
# check java home
-if [[ -z ${JAVA_HOME} ]]; then
- echo "Error: JAVA_HOME is not set"
- exit 1
+if [ -z "$JAVA_HOME" ] ; then
+ export JAVACMD=`which java`
Review comment:
4 spaces?
##########
File path: fs_brokers/apache_hdfs_broker/bin/start_broker.sh
##########
@@ -41,14 +41,19 @@ export PID_DIR=`cd "$curdir"; pwd`
export JAVA_OPTS="-Xmx1024m -Dfile.encoding=UTF-8"
export BROKER_LOG_DIR="$BROKER_HOME/log"
-# export JAVA_HOME="/usr/java/jdk1.8.0_131"
# java
-if [ "$JAVA_HOME" = "" ]; then
- echo "Error: JAVA_HOME is not set."
- exit 1
+if [ -z "$JAVA_HOME" ] ; then
+ JAVA=`which java`
Review comment:
4 spaces
##########
File path: gensrc/script/gen_build_version.sh
##########
@@ -77,14 +77,18 @@ build_short_hash="${short_revision}"
build_time="${date}"
build_info="${user}@${hostname}"
-java_cmd=
-if [[ (-n "$JAVA_HOME") && (-x "$JAVA_HOME/bin/java") ]]; then
- java_cmd="$JAVA_HOME/bin/java"
+if [ -z "$JAVA_HOME" ] ; then
+ java_cmd=`which java`
Review comment:
4 spaces
--
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: commits-unsubscribe@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org