Actually, this should work straightforward. I just did it. This is the console log:
user@user:~/Downloads$ chmod u+x esa-snap_all_unix_6_0.sh
user@user:~/Downloads$ ./esa-snap_all_unix_6_0.sh
Unpacking JRE ...
Preparing JRE ...
Starting Installer ...
Here the installation ends succesfully.
user@user:~/Downloads$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
...
user@user:~/Downloads$
One year ago someone had a similar problem. You could ask him if he solved it and how.