title: how to run kubectl command in java
body: <p>I can run <code>kubectl get secret/rabbitmq-expressmode -n expressmode</code> in shell successfully.</p>
  <p>However when I try to run it in java with either <code>ProcessBuilder</code> or <code>Runtime.getRuntime().exec</code>, the error:</p>
  <pre><code>Error from server (BadRequest): the server rejected our request for an unknown reason
  </code></pre>
  <p>is thrown out.</p>
  <p>What's the possible reason?</p>