[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-16 Thread Brandon Williams (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17382059#comment-17382059
 ] 

Brandon Williams commented on CASSANDRA-14325:
--

Committed, thank you!

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.25, 3.11.11, 4.0.1
>
> Attachments: 3.x.patch, trunk.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-16 Thread Angelo Polo (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381960#comment-17381960
 ] 

Angelo Polo commented on CASSANDRA-14325:
-

Patches for trunk/4.0 and 3.11/3.0 attached.

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: 3.x.patch, trunk.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-15 Thread Brandon Williams (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381447#comment-17381447
 ] 

Brandon Williams commented on CASSANDRA-14325:
--

These seem to only to apply to 4.0 and up.  Were you still interested in fixing 
this in 3.0 and 3.11?

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.in.sh.patch, redhat_cassandra.in.sh.patch, 
> tools_bin_cassandra.in.sh.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-15 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381435#comment-17381435
 ] 

Ekaterina Dimitrova commented on CASSANDRA-14325:
-

And seems our comments crashed, thanks again :) 

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.in.sh.patch, redhat_cassandra.in.sh.patch, 
> tools_bin_cassandra.in.sh.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-15 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381431#comment-17381431
 ] 

Ekaterina Dimitrova commented on CASSANDRA-14325:
-

+1, thank you. I am also adding [~azotcsit] as a reviewer as he also did a pass.

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.in.sh.patch, redhat_cassandra.in.sh.patch, 
> tools_bin_cassandra.in.sh.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-15 Thread Aleksei Zotov (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381430#comment-17381430
 ] 

Aleksei Zotov commented on CASSANDRA-14325:
---

+1 (non-binding)

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.in.sh.patch, redhat_cassandra.in.sh.patch, 
> tools_bin_cassandra.in.sh.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-15 Thread Angelo Polo (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381407#comment-17381407
 ] 

Angelo Polo commented on CASSANDRA-14325:
-

That's a nice simplification. I've attached patches for all three files.

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.in.sh.patch, redhat_cassandra.in.sh.patch, 
> tools_bin_cassandra.in.sh.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-08 Thread Benjamin Lerer (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17377196#comment-17377196
 ] 

Benjamin Lerer commented on CASSANDRA-14325:


Thanks a lot [~azotcsit]. Any review comment will help us to move faster.

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-14325) Java executable check succeeds despite no java on PATH

2021-07-07 Thread Alexey Zotov (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-14325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17376785#comment-17376785
 ] 

Alexey Zotov commented on CASSANDRA-14325:
--

The patch looks good to me, however, I have two small comments:
 1. Even though the patch's logic seems to be working perfectly well, I feel 
the same can be achieved in a bit more compact way:
{code:java}
diff --git a/bin/cassandra.in.sh b/bin/cassandra.in.sh
index 58b4dd2896..5d13cdae70 100644
--- a/bin/cassandra.in.sh
+++ b/bin/cassandra.in.sh
@@ -95,7 +95,7 @@ if [ -n "$JAVA_HOME" ]; then
 fi
 done
 else
-JAVA=java
+JAVA=`command -v java 2> /dev/null`
 fi
 
 if [ -z $JAVA ] ; then
{code}
If there is no _java_ executable available then _JAVA_ variable will be empty 
and _if [ -z $JAVA ]_ condition will match to trigger the error.

2. I can see two more similar scripts and I believe they need to be updated as 
well:
{code:java}
redhat/cassandra.in.sh
tools/bin/cassandra.in.sh
{code}
 

PS:
I'm not a project committer. I've just chimed in after seeing [~blerer]'s email 
seeking for reviewers.

 

> Java executable check succeeds despite no java on PATH
> --
>
> Key: CASSANDRA-14325
> URL: https://issues.apache.org/jira/browse/CASSANDRA-14325
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local/Startup and Shutdown
>Reporter: Angelo Polo
>Assignee: Angelo Polo
>Priority: Low
> Fix For: 3.0.x, 3.11.x, 4.0.x
>
> Attachments: bin_cassandra.patch
>
>
> The check -z $JAVA on line 102 of bin/cassandra currently always succeeds if 
> JAVA_HOME is not set since in this case JAVA gets set directly to 'java'. The 
> error message "_Unable to find java executable. Check JAVA_HOME and PATH 
> environment variables._" will never be echoed on a PATH misconfiguration. If 
> java isn't on the PATH the failure will instead occur on line 95 of 
> cassandra-env.sh at the java version check.
> It would be better to check consistently for the java executable in one place 
> in bin/cassandra. Also we don't want users to mistakenly think they have a 
> java version problem when they in fact have a PATH problem.
> See proposed patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org