executing a jar file through a bash script
<p>I want to execute a jar file using java -jar command from a bash script. At the same time I'm passing few parameters which I can access in my main method, using args[].</p>

<p>I'm able to do this without any issues if I try,</p>

<pre><code>java -jar org.sample.jar localhost 8080
</code></pre>

<p>but I want to make these parameters configurable through few variables.</p>

<p>Eg:- </p>

<pre><code>HOST=localhost
PORT=8080
</code></pre>

<p>When I try to use above variables like following, bash script fails silently.  </p>

<pre><code>java -jar org.sample.jar $HOST $PORT
</code></pre>

<p>I also tried using "$HOST" but without any luck. What am I doing wrong here?</p>

<p><strong>UPDATE</strong></p>

<p><strong>I was using cygwin to execute/debug my bash script. Once I execute the same script using git bash it works.</strong></p>