I am trying to write a Bash script to (amongst other things) run a particular Java programme stored in a .jar file.
The script is in a directory we will call
foo. It includes this line
java -jar ~/Simutrans-Extended/simutrans-extended/Nightly-Updater-V2.jar -cl
When I run the script, the .jar file executes as though it were running in
foo. But I need it to be executed in its actual location, in this case
~/Simutrans-Extended/simutrans-extended/. How do I do this please?
The script is running on Ubuntu 20.04, should that be relevant.