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[].
I'm able to do this without any issues if I try,
java -jar org.sample.jar localhost 8080
but I want to make these parameters configurable through few variables.
Eg:-
HOST=localhost
PORT=8080
When I try to use above variables like following, bash script fails silently.
java -jar org.sample.jar $HOST $PORT
I also tried using "$HOST" but without any luck. What am I doing wrong here?
UPDATE
I was using cygwin to execute/debug my bash script. Once I execute the same script using git bash it works.