[ 
https://issues.apache.org/jira/browse/KAFKA-5507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Evgeny Veretennikov updated KAFKA-5507:
---------------------------------------
    Description: 
Steps to reproduce problem:
1. Clone Kafka repo using {{git clone}}.
2. Run some Bash-script, which invokes {{kafka-run-class.sh}} (without building 
project beforehand).

For example:
{{$ ./bin/zookeeper-server-start.sh config/zookeeper.properties}}
{{Error: Could not find or load main class config.zookeeper.properties}}

Error is misleading. This happens, because {{kafka-run-class.sh}} tries to run 
this command:
{{java ...a lot of JVM options... -cp 
org.apache.zookeeper.server.quorum.QuorumPeerMain config/zookeeper.properties}}

Script doesn't check for empty {{$CLASSPATH}} variable. It's empty, because we 
didn't build project.

{{kafka-run-class.bat}} script for Windows checks for it:
{{IF ["%CLASSPATH%"] EQU [""] (}}
{{      echo Classpath is empty. Please build the project first e.g. by running 
'gradlew jarAll'}}
{{      EXIT /B 2}}
{{)}}

I think, we should add similar check to Bash-script, and show similar error.

  was:
Steps to reproduce problem:
1. Clone Kafka repo using {{git clone}}.
2. Run some Bash-script, which invokes {{kafka-run-class.sh}} (without building 
project beforehand).

For example:
{{$ ./bin/zookeeper-server-start.sh config/zookeeper.properties}}
{{Error: Could not find or load main class config.zookeeper.properties}}

Error is misleading. This happens, because {{kafka-run-class.sh}} tries to run 
this command:
{{java ...a lot of JVM options... -cp 
org.apache.zookeeper.server.quorum.QuorumPeerMain config/zookeeper.properties}}

Script doesn't check for empty {{$CLASSPATH}} variable. It's empty, because we 
didn't build project.

{{kafka-run-class.bat}} script for Windows checks for it:
{{IF ["%CLASSPATH%"] EQU [""] ({{
{{      echo Classpath is empty. Please build the project first e.g. by running 
'gradlew jarAll'}}
{{      EXIT /B 2}}
{{)}}

I think, we should add similar check to Bash-script, and show similar error.


> kafka-run-class.sh doesn't check for empty $CLASSPATH
> -----------------------------------------------------
>
>                 Key: KAFKA-5507
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5507
>             Project: Kafka
>          Issue Type: Bug
>          Components: tools
>    Affects Versions: 0.10.2.1
>         Environment: Linux
>            Reporter: Evgeny Veretennikov
>            Assignee: Evgeny Veretennikov
>            Priority: Minor
>
> Steps to reproduce problem:
> 1. Clone Kafka repo using {{git clone}}.
> 2. Run some Bash-script, which invokes {{kafka-run-class.sh}} (without 
> building project beforehand).
> For example:
> {{$ ./bin/zookeeper-server-start.sh config/zookeeper.properties}}
> {{Error: Could not find or load main class config.zookeeper.properties}}
> Error is misleading. This happens, because {{kafka-run-class.sh}} tries to 
> run this command:
> {{java ...a lot of JVM options... -cp 
> org.apache.zookeeper.server.quorum.QuorumPeerMain 
> config/zookeeper.properties}}
> Script doesn't check for empty {{$CLASSPATH}} variable. It's empty, because 
> we didn't build project.
> {{kafka-run-class.bat}} script for Windows checks for it:
> {{IF ["%CLASSPATH%"] EQU [""] (}}
> {{    echo Classpath is empty. Please build the project first e.g. by running 
> 'gradlew jarAll'}}
> {{    EXIT /B 2}}
> {{)}}
> I think, we should add similar check to Bash-script, and show similar error.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to