#### Expected behavior
Expect to list the clusters I have created.
#### Actual behavior
It failed with Error: Could not find or load main class "
#### Steps to reproduce
* Deploy pulsar in a k8s cluster by using helm charts.
* kubectl exec -ti -n ... pulsar-broker-... bash
* ./bin/pulsar-admin clusters list
#### System configuration
**Pulsar version**: 2.1.0-incubating
We find the problem is the conf/pulsar_tool_env.sh, the
`PULSAR_MEM=${PULSAR_MEM:-"-Xmx256m -XX:MaxDirectMemorySize=256m"}`
It should not take the PULSAR_MEM from env, it caused the actual command to
exec to be:
```exec /docker-java-home/bin/java -cp '/pulsar/conf:::/pulsar/lib/*:'
-Dlog4j.configurationFile=log4j2.yaml -Djava.net.preferIPv4Stack=true '"'
-Xms1g -Xmx1g '-XX:MaxDirectMemorySize=1g"' -client
-Dio.netty.leakDetectionLevel=disabled -Dpulsar.log.appender=RoutingAppender
-Dpulsar.log.dir=/pulsar/logs -Dpulsar.log.level=info
-Dpulsar.routing.appender.default=Console
-Dpulsar.functions.java.instance.jar=/pulsar/instances/java-instance.jar
-Dpulsar.functions.python.instance.file=/pulsar/instances/python-instance/python_instance_main.py
org.apache.pulsar.admin.cli.PulsarAdminTool /pulsar/conf/client.conf clusters
list```
The problem is fixed with the following fix:
```diff conf/pulsar_tools_env.sh.orig conf/pulsar_tools_env.sh
45c45
< PULSAR_MEM=${PULSAR_MEM:-"-Xmx256m -XX:MaxDirectMemorySize=256m"}
---
> PULSAR_MEM="-Xmx256m -XX:MaxDirectMemorySize=256m"
```
[ Full content available at:
https://github.com/apache/incubator-pulsar/issues/2481 ]
This message was relayed via gitbox.apache.org for [email protected]