You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "kofemann (via GitHub)" <gi...@apache.org> on 2026/08/24 09:06:09 UTC

[PR] respect JAVA_HOME when checking java version [cassandra]

kofemann opened a new pull request, #5053:
URL: https://github.com/apache/cassandra/pull/5053

   On start, cassandra can use `java` from the path or based on JAVA_HOME environment. However, the check for a support JVM version uses only path, ignoring the JAVA_HOME.
   
   
   
   


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#discussion_r3870788667


##########
bin/cassandra.in.sh:
##########


Review Comment:
   very similar kind of issue, we prefer javac over the selected JAVA, probably we should do something like this:
   ```
   USING_JDK=$(command -v "$(dirname "$JAVA")/javac")
   ```



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "michaelsembwever (via GitHub)" <gi...@apache.org>.
michaelsembwever commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5743312101

   What happens when `JAVA_HOME` is JDK 21  but  JDK 17 is (first) on `PATH`.  Do we  run the correct jdk and read the correct corresponding `jvm*-server.options` file ? 
   


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "michaelsembwever (via GitHub)" <gi...@apache.org>.
michaelsembwever commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5743286921

   `redhat/cassandra.in.sh` line 168 still reads `USING_JDK=$(command -v javac || command -v "${JAVA_HOME:-/usr}/bin/javac")`. The pull request corrected that line in `bin/` and `tools/bin/` but not there.
   


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5393768604

   https://issues.apache.org/jira/browse/CASSANDRA-21598


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5568644567

   hi @kofemann  are you available / still around to finish this one? 


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#discussion_r4053593085


##########
bin/cassandra.in.sh:
##########
@@ -118,7 +118,7 @@ java_versions_supported="11 17 21"
 java_version_string=$(IFS=" "; echo "${java_versions_supported}")
 
 # Determine the sort of JVM we'll be running on.
-JAVA_VERSION=$(java -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)
+JAVA_VERSION=$($JAVA -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)

Review Comment:
   still valid, as well as in few other places 



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#discussion_r4053595157


##########
redhat/cassandra.in.sh:
##########


Review Comment:
   this line still has the old logic



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "kofemann (via GitHub)" <gi...@apache.org>.
kofemann commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5744583189

   I think the issue must be fixed by eliminating code duplication in scripts.


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#discussion_r3870752364


##########
bin/cassandra.in.sh:
##########
@@ -118,7 +118,7 @@ java_versions_supported="11 17 21"
 java_version_string=$(IFS=" "; echo "${java_versions_supported}")
 
 # Determine the sort of JVM we'll be running on.
-JAVA_VERSION=$(java -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)
+JAVA_VERSION=$($JAVA -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)

Review Comment:
   $JAVA should be quoted to not break if the path contains a space (here and in other places)



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "kofemann (via GitHub)" <gi...@apache.org>.
kofemann closed pull request #5053: CASSANDRA-21598 respect JAVA_HOME when checking java version
URL: https://github.com/apache/cassandra/pull/5053


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "kofemann (via GitHub)" <gi...@apache.org>.
kofemann commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5398571538

   @smiklosovic Thanks for the prompt review. I have updated the other location too that looked relevant.


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "kofemann (via GitHub)" <gi...@apache.org>.
kofemann commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5575497393

   @smiklosovic yeah, still want to finish it. just need some time to implement changes and test 


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "netudima (via GitHub)" <gi...@apache.org>.
netudima commented on code in PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#discussion_r4053593085


##########
bin/cassandra.in.sh:
##########
@@ -118,7 +118,7 @@ java_versions_supported="11 17 21"
 java_version_string=$(IFS=" "; echo "${java_versions_supported}")
 
 # Determine the sort of JVM we'll be running on.
-JAVA_VERSION=$(java -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)
+JAVA_VERSION=$($JAVA -version 2>&1 | grep '[openjdk|java] version' | cut -d '"' -f2 | cut -d '.' -f1)

Review Comment:
   still valid



-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSANDRA-21598 respect JAVA_HOME when checking java version [cassandra]

Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic commented on PR #5053:
URL: https://github.com/apache/cassandra/pull/5053#issuecomment-5393833153

   hi @kofemann , I think this needs to happen also in `tools/bin/cassandra.in.sh` and `redhat/cassandra.in.sh`


-- 
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: pr-unsubscribe@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org